A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
| # Usage: | |
| # source iterm2.zsh | |
| # iTerm2 window/tab color commands | |
| # Requires iTerm2 >= Build 1.0.0.20110804 | |
| # http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes | |
| tab-color() { | |
| echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
| echo -ne "\033]6;1;bg;green;brightness;$2\a" | |
| echo -ne "\033]6;1;bg;blue;brightness;$3\a" |
| # ~/.tmux.conf | |
| # | |
| # See the following files: | |
| # | |
| # /opt/local/share/doc/tmux/t-williams.conf | |
| # /opt/local/share/doc/tmux/screen-keys.conf | |
| # /opt/local/share/doc/tmux/vim-keys.conf | |
| # | |
| # URLs to read: | |
| # |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| uglify: { | |
| options: { | |
| sourceMap: true, | |
| sourceMapIncludeSources: true, | |
| sourceMapIn: 'js/app.coffee.js.map' | |
| }, |
| ## From a post on the ML, apropos this: | |
| ## http://lowlatencyweb.wordpress.com/2012/03/20/500000-requestssec-modern-http-servers-are-fast. | |
| ## For sysctl.conf | |
| net.ipv4.tcp_slow_start_after_idle = 0 | |
| echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range | |
| echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle | |
| echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse |
| Alien = class() | |
| -- Free game by juaxix | |
| -- http://www.xixgames.com | |
| -- Copyright LGPL - 11/2011 | |
| function Alien:init(avoidy) | |
| self.position = vec2(0,math.max(math.abs(math.random(HEIGHT)-avoidy)),66) | |
| self.angle = math.pi | |
| self.points= 500 | |
| end |
| var request = require('request'); | |
| var unzip = require('unzip'); | |
| var csv2 = require('csv2'); | |
| request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip') | |
| .pipe(unzip.Parse()) | |
| .on('entry', function (entry) { | |
| entry.pipe(csv2()).on('data', console.log); | |
| }) | |
| ; |
| function smsMail() | |
| { | |
| try | |
| { | |
| var label = GmailApp.getUserLabelByName('smsMail'); | |
| var threads = label.getThreads(); | |
| var now = new Date().getTime(); | |
| var cal=getCalendar(); | |
| for(i in threads) |
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
| open Core.Std | |
| module Substring = struct | |
| include Substring | |
| let get t i = (Substring.base t).[(Substring.pos t) + i] | |
| let drop_prefix_str t ~prefix = | |
| let len = String.length prefix in | |
| if len > Substring.length t then None | |
| else |