Skip to content

Instantly share code, notes, and snippets.

var x = 4;
function change(v) {
v = v + 9;
}
change(x);
console.log(x); // 4
@harthur
harthur / mc-github.md
Created May 5, 2011 23:13
Stuff to do for a mozilla-central on github
  • have a README.md
  • pull request with bug number will upload patch to bug
@harthur
harthur / gist:992175
Created May 25, 2011 22:46
repos from the first Silicon Valley Hack and Tell meetup
var async = require("async"),
github = new (require("github").GitHubApi)(),
users = github.getUserApi(),
names = require("./femalenames").slice(0, 50),
cradle = require("cradle"),
fs = require("fs");
var toFollow = [];
function dateAgo(daysAgo) {
@harthur
harthur / lexicon.js
Created September 20, 2011 18:22
Problem require'ing a huge module in CouchDB CommonJS
module.exports = {
"Ranavan": [
"NNP"
],
"fawn": [
"NN"
],
"pro-Soviet": [
"JJ"
],
@harthur
harthur / tweets.js
Created October 25, 2011 19:25
tweets.js
var ntwitter = require("ntwitter"),
growl = require("growl");
var twitter = new ntwitter({
// fill in w/ keys from https://dev.twitter.com/apps/new
consumer_key: null,
consumer_secret: null,
access_token_key: null,
access_token_secret: null
});
@harthur
harthur / scratchpad.js
Created March 22, 2012 14:44 — forked from paulrouget/scratchpad.js
Firefox Magnifier
/*
TODO:
- zoom level menu
- need to find a way to re-start the update
- add color tools
- integrate better in Firefox
- crosshair has a 1px offset
*/
@harthur
harthur / gist:2310787
Created April 5, 2012 12:42
`brew doctor` output
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/local/bin/icu-config
@harthur
harthur / renderedfont.js
Created April 18, 2012 16:15
Get rendered font-family
function getRenderedFontFamily(fontFamily) {
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
let families = fontFamily.split(/\s*,\s*/);
for each (let family in families) {
if (family == 'inherit') {
return family;
}
@harthur
harthur / fetchgrams.js
Created May 2, 2012 22:50
Download pictures with cat tag from Instagram
var http = require("http"),
url = require("url"),
fs = require("fs"),
async = require("async"),
Instagram = require('instagram-node-lib');
Instagram.set('client_id', /* client key */);
Instagram.set('client_secret', /* client secret */);
fetchTag('cat', 400);