myobj.to_json
.h = {b: BigDecimal.new('12.34'), s: 'string'}
puts h.to_json
rasterizeHTML.drawHTML($('#wrap')[0].outerHTML,canvas).then(function success(renderResult) {
canvas = document.getElementById("canvas_c");
var data=canvas.toDataURL();
// resize the canvas
canvas.width = width;
canvas.height = height;
// scale and redraw the canvas content
var img=new Image();
img.onload=function() {
var ctx=canvas.getContext("2d");
ctx.drawImage(img,0,0,img.width,img.height,0,0,canvas.width,canvas.height);
var imgData = canvas.toDataURL("image/png", 1.0);
var doc = new jsPDF();
doc.addImage(imgData, 'PNG', 5, 5, width/15, height/15);
doc.save('filename.pdf');
};
img.src=data;
});
function myStripTags(html) {
var tmp = document.createElement("div");
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || "";
}
var text = html.replace(/<.+>/g, '')
puts "[#{ children_code.map{|cc| "'#{cc}'"}.join(',') }]"
puts "[%s]" % children_code.map{|cc| "'#{cc}'"}.join(',')
ON DELETE CASCADE
funcCall( this.myFunc.bind(this) );
scope module: :institution do
root action: :index, controller: :base
end
tr:nth-child(n+y_min):nth-child(-n+y_max) td:nth-child(n+x_min):nth-child(-n+x_max)
Определяй структуру объекта в конструкторе и никогда не меняй после!
function AObj(arr){
arr.forEach( v => Object.assign(this, { [v]: objVal } ) );
}
var aObj = new AObj([1,2,3]);