Skip to content

Instantly share code, notes, and snippets.

@dy-dx
dy-dx / shadowing.js
Created March 10, 2014 16:57
Inherited property shadowing in JavaScript
function Foobar () {
}
Foobar.prototype.foo = 1;
Foobar.prototype.bar = {qux: 1};
Foobar.prototype.baz = {qux: 1};
var a = new Foobar();
var b = new Foobar();
@dy-dx
dy-dx / sizzlingstats-status
Last active August 29, 2015 14:03
Sizzlingstats status
2014-07-14 13:12:01 -0400
The server is down, I am working on it. I will post updates here as they occur.
This is unlikely to be resolved within the next 12 hours.
2014-07-15 14:34:02 -0400
All previously recorded data has been preserved, but no new stats will be recorded while the server is down.
The restoration process should be completed within the next 24 hours.
@dy-dx
dy-dx / pivotal-story-ids.js
Created August 4, 2014 15:58
Bookmarklet for generating a "[Fixes #XXXXXXXX #YYYYYYYY]" string for pull requests that reference Pivotal story IDs.
javascript:(function() {
var ids = _.uniq($('.visible .selected').closest('.story').map(function() { return this.className.match(/story_(\d+)/)[1]; }));
var prString = '[Fixes #' + ids.join(' #') + ']';
window.prompt('Copy to clipboard:', prString);
})();
{
"coffeescript_error": {
"level": "error"
},
"arrow_spacing": {
"name": "arrow_spacing",
"level": "ignore"
},
"no_tabs": {
"name": "no_tabs",
lodash = _ = require('lodash')
request = require('request')
teamListUrl = () -> 'http://prod-api-madden.grw.io/api/teams'
# teamKey == 'bills' for example
templateDataUrl = (teamKey) -> "http://prod-api-madden.grw.io/api/templates/team-key/#{teamKey}"
gifDataUrl = (templateKey) ->
"http://prod-api-madden.grw.io/api/memes/template-key/#{templateKey}"
module Pi where
import Random
import Signal
import List
import Graphics.Element (Element, empty)
import Graphics.Collage (..)
import Color
import String
import Window
import Graphics.Element (Element)
import Graphics.Collage (collage, textured, circle)
main : Element
main =
collage 800 600
[textured "http://placehold.it/200x200" (circle 200.0)]
import sys, os, glob
import readline
import pyaudio
import wave
from pydub import AudioSegment
from pydub.utils import get_player_name, make_chunks
CHUNK = 1024
@dy-dx
dy-dx / gource.sh
Created November 27, 2013 19:01
gource & ffmpeg settings
#!/bin/bash
gource \
--user-image-dir avatars/ \
--title "viewthespace" \
--highlight-users \
--user-scale 3 \
--auto-skip-seconds 0.01 \
--file-idle-time 0 \
--highlight-colour 00FF00 \
@dy-dx
dy-dx / index.coffee
Created December 9, 2013 16:50
node.js script for listing closed + unmerged pull requests. Useful for tracking closed pull requests that may have been forgotten.
# Configuration
cfg =
oauth_token: ''
repo: 'viewthespace/viewthespace'
number_of_pulls: 40
timeout: 5000
unless cfg.oauth_token.length
return console.error """
Please generate an oauth token and place in cfg object.