Skip to content

Instantly share code, notes, and snippets.

View jbt's full-sized avatar

James Taylor jbt

View GitHub Profile
@jbt
jbt / thing.js
Created April 6, 2013 12:47
Thought Exercise
// Without running this: what gets logged in what order?
var a = {};
Object.defineProperty(a, 'a', { get: function(){
console.log('get a');
return function(){ console.log('a'); return a; };
}});
Object.defineProperty(a, 'b', { get: function(){
@jbt
jbt / desk.coffee
Last active August 29, 2015 13:56
Desk.com hubot script
# hubot script for desk
module.exports = (robot) ->
robot.router.post "/hook/desk", (req, res) ->
body = req.body.data
lines = body.split "\n"
data = {}
lines.forEach (line) ->
bits = line.split ":"
data[bits.shift()] = bits.join ":"
@jbt
jbt / livecat.js
Created April 1, 2016 08:46
GoSquared Embedded Live Cat
function embedLiveCatTM() {
var πŸ“„ = document, πŸ’… = "style", β¬… = "left", ⬇ = "bottom", πŸ‘ = "translateX(-50%)", 🐳 = window,
↕ = "innerHeight", ↔ = "innerWidth", 😺 = 0, 🐈 = 🐳[↔] / 2, πŸ–– = 0, 🎺 = 0, πŸ‘» = "px",
πŸ”’ = Math, ⏲ = setInterval, πŸ’©, 🐱 = πŸ“„.createElement("img");
🐱.setAttribute("src", "//static.gosquared.com/images/april/nes/cat_02.png");
🐱[πŸ’…].height = 🐳[↕] / 20 * 10 + πŸ‘»;
🐱[πŸ’…].position = "fixed";
🐱[πŸ’…].transform = πŸ‘;
πŸ“„.body.appendChild(🐱);
(function πŸ–Œ(){