As configured in my dotfiles.
start new:
tmux
start new with session name:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Testing Pie Chart</title> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
| <style type="text/css"> |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Simple gevent POC to check how to get ZMQ sockets working with | |
| subprocesses spawned by a simple process.""" | |
| # this code doesn't seem to work properly; it has a | |
| # tendency to hang at various parts of the req/rep process | |
| # all of this stuff works flawlessly if you change: |
| // snippet taken from http://catapulty.tumblr.com/post/8303749793/heroku-and-node-js-how-to-get-the-client-ip-address | |
| function getClientIp(req) { | |
| var ipAddress; | |
| // The request may be forwarded from local web server. | |
| var forwardedIpsStr = req.header('x-forwarded-for'); | |
| if (forwardedIpsStr) { | |
| // 'x-forwarded-for' header may return multiple IP addresses in | |
| // the format: "client IP, proxy 1 IP, proxy 2 IP" so take the | |
| // the first one | |
| var forwardedIps = forwardedIpsStr.split(','); |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| from fabric.api import * | |
| from fabric.colors import green as _green, yellow as _yellow | |
| import boto | |
| import boto.ec2 | |
| from config import * | |
| import time | |
| def create_server(): | |
| """ | |
| Creates EC2 Instance |
| /* CSS for Collapsible Blog Posts */ | |
| [id^=_] { | |
| display: none; | |
| } |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "time" | |
| ) | |
| var urls = []string{ | |
| "https://splice.com/", |
| var Promise = require('bluebird'); | |
| var promiseWhile = function(condition, action) { | |
| var resolver = Promise.defer(); | |
| var loop = function() { | |
| if (!condition()) return resolver.resolve(); | |
| return Promise.cast(action()) | |
| .then(loop) | |
| .catch(resolver.reject); |
| from toolz import concat | |
| def page_iterator(query, page_size=999, **kwargs): | |
| ''' | |
| Returns an iterator over pages of a query. | |
| Can be used to work-around the 1000 entity limit in remote_api_shell | |
| :params query: The query we're using. | |
| :params page_size: The page size to return. | |
| :params qwargs: Additional options for fetch_page |
| # be sure to comment out the require 'capistrano/deploy' line in your Capfile! | |
| # config valid only for Capistrano 3.1 | |
| lock '3.2.1' | |
| set :application, 'my-cool-application' | |
| # the base docker repo reference | |
| set :name, "johns-stuff/#{fetch(:application)}" |