Skip to content

Instantly share code, notes, and snippets.

View file.js
[1,2,3].map(x => x * x)
jbalogh / gist:5155003
Created Mar 13, 2013
user style for
View gist:5155003
.message_list {
background-color: transparent !important;
.recipient_row {
border: none !important;
.recipient_row .left_part {
background-color: transparent !important;
jbalogh / 1-simple.js
Created Jan 30, 2012
push notifications API
View 1-simple.js
var notification = (navigator.notification ||
navigator.mozNotification ||
if (notification) {
// Ask the user to allow notifications.
var request = notification.requestRemotePermission();
request.onsuccess = function() {
var url = request.result;
console.log('New push URL: ' + url);
// We got a new push URL, store it on the server.
jbalogh /
Created May 19, 2011 — forked from oremj/
amo deploy using commander
import os
from commander.deploy import hostgroups, local_command
AMO_DIR = "/data/amo_python/src/prod/zamboni"
_amo_dir = lambda *p: os.path.join(AMO_DIR, *p)
_git_lcmd = lambda ctx, c: ctx.local("/usr/bin/git %s" % c)
jbalogh /
Created Apr 8, 2011
Install all the tools you need to get playdoh set up.
# pip is a tool for installing Python packages.
sudo easy_install pip
# Essential tools for any self-respecting Python programmer.
sudo pip install virtualenv virtualenvwrapper ipython
# This is where we keep Python environments.
mkdir ~/.virtualenvs
# Set up our shell for virtualenvwrapper.
jbalogh / _recommend.c
Created Apr 7, 2011
C extension for calculating addon recommendations
View _recommend.c
#include <Python.h>
PyObject *array, *ArrayType;
/* Specialized _symmetric_diff_count for array.array() objects.
* We get to skip all the GC and rich comparison functions since array()
* stores C types directly.
* This calculates len(set(xs).symmetric_difference(ys)) without the
* extra data structures in between. xs and ys must be sorted in
jbalogh / nginx.conf
Created Mar 21, 2011
nginx.conf for serving glow
View nginx.conf
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/;
#!/usr/bin/env python
git log next..master --oneline |
git cherry next master -v |
pip install termcolor
jbalogh / proxyproxy.js
Created Nov 9, 2010
node.js duplex proxy for load testing with production traffic
View proxyproxy.js
/* A node.js proxy that forwards requests to two upstream servers, but only
* returns the response from one. Might be useful for load testing with
* production traffic.
var http = require('http');
/* The request is forwarded to both proxies, but only the response from proxy1
* is returned.
var proxy1 = [8001, 'localhost'],