I hereby claim:
- I am valueof on github.
- I am antonkovalyov (https://keybase.io/antonkovalyov) on keybase.
- I have a public key whose fingerprint is 6BF4 15DC BC53 1C0C 9418 480B 0882 526B 2DC7 2A98
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var iframe = document.querySelector('#myid') | |
window.addEventListener('message', function (ev) { | |
var message = ev.data.split(':') | |
if (message[0] === iframe.id) { | |
iframe.style.height = message[1] + 'px' | |
iframe.style.width = message[2] + 'px' | |
} | |
}) |
<!doctype html> | |
<style>body {background-color: red; height: 500px; width: 500px;}</style> | |
<script> | |
window.addEventListener('message', function (ev) { | |
var message = ev.data.split(':') | |
if (message[0] != 'yo') { | |
return | |
} | |
<iframe id="myid" src="embed.html" onload="var i=document.querySelector('#myid'),a=i.id,s='style';window.addEventListener('message',function(e){var m=e.data.split(':');if(m[0] == a)i[s].height=m[1],i[s].width=m[2]});i.contentWindow.postMessage('yo:'+a,'*')"> |
;; https://gist.github.com/antonkovalyov/8663025 | |
{:+ { | |
;; The app tag is kind of like global scope. You assign behaviors that affect | |
;; all of Light Table here | |
:app [(:lt.objs.style/set-skin "light")] | |
;; The editor tag is applied to all editors | |
:editor [:lt.objs.editor/no-wrap | |
(:lt.objs.style/set-theme "solarized-light") |
// Candidate 1 | |
JSON.parse(JSON.stringify(obj)); | |
// Candidate 2 | |
var desc = {}; | |
Object.keys(obj).forEach(function(key) { | |
desc[key] = Object.getOwnPropertyDescriptor(obj, key); | |
}); | |
Object.create(Object.prototype, desc); |
{ |
Original lyrics: http://rapgenius.com/Kendrick-lamar-maad-city-lyrics | |
If Node peeps and Crock all got along | |
They'd probably gun me down by the end of this song | |
-- | |
Seem like the whole codebase go against me | |
Every time I run my tests I hear | |
BUG BUG BUG BUG |
function bind(obj) { | |
let bound = {}; | |
for (let key in obj) { | |
bound[key] = typeof obj[key] === "function" ? obj[key].bind(obj) : obj[key]; | |
} | |
return bound; | |
} |
ProfilerPanel.prototype = { | |
stopProfiling: function () { | |
this.controller.isActive(function (err, isActive) { | |
if (err) { | |
Cu.reportError("ProfilerController.isActive: " + err.message); | |
return; | |
} | |
if (!isActive) { | |
return; |