Turn a mercator projection into a dotted map.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1,2,3].map(x => x * x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.message_list { | |
background-color: transparent !important; | |
} | |
.recipient_row { | |
border: none !important; | |
} | |
.recipient_row .left_part { | |
background-color: transparent !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var notification = (navigator.notification || | |
navigator.mozNotification || | |
navigator.webkitNotification); | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Usage: | |
git log next..master --oneline | milestones.py | |
git cherry next master -v | milestones.py | |
Requirements: | |
pip install termcolor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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'], |
NewerOlder