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
# ZSH Theme by @cpojer | |
PROMPT='[%{$fg[red]%}%n%{$fg[black]%}: %{$fg[blue]%}%~%{$reset_color%}\ | |
$(git_prompt_info)\ | |
%{$fg[black]%}%(!.#.]$)%{$reset_color%} ' | |
PROMPT2='' | |
RPS1='' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%} %{$fg[yellow]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}" |
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
# urlmonitor - print out the URLs requested system wide on the main network interface | |
# Accept a network interface name as an optional argument | |
iface = ARGV.first | |
# No interface specified? Try to guess which one is king.. | |
unless iface | |
`ifconfig -l`.split.each do |iface| | |
next if iface =~ /^lo/ | |
break if `ifconfig #{iface}` =~ /inet (0|1|2)/ |
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
require 'net/http' | |
require 'uri' | |
RIAK = ['localhost', 8098] | |
run lambda { |env| | |
req = Rack::Request.new(env) | |
if req.post? && req.path == '/' | |
res = Net::HTTP.new(*RIAK).start do |http| | |
http.post('/riak/shrt', req.params['url'], { 'Content-Type' => 'text/plain' }) |
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
git remote add --track master upstream git://github.com/upstreamname/projectname.git |
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
---------- Forwarded message ---------- | |
From: Mark S. Miller <[email protected]> | |
Date: Tue, Nov 16, 2010 at 3:44 PM | |
Subject: "Future of Javascript" doc from our internal "JavaScript Summit" | |
last week | |
To: [email protected] | |
On November 10th and 11th, a number of Google teams representing a variety | |
of viewpoints on client-side languages met to agree on a common vision for | |
the future of Javascript. |
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
qemu-img create -f raw NAME.img 8G | |
virt-install --name='VNAME' --ram=512 --vcpus=1 --description='' --cdrom=/share/downloads/centos-6.2-x86_64-minimal.iso --disk=/share/vos/VNAME.img --vnc --noautoconsole --force | |
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
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
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
background: #f06; | |
background: linear-gradient(60deg, #f06, yellow); | |
min-height: 100%; | |
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
fib = (n)-> | |
arr = {} | |
$ = (_) -> | |
return _ if _ < 2 | |
return arr[_] if arr[_] | |
arr[_] = $(_-1) + $(_-2) | |
arr[_] | |
$(n) | |
console.time('a') |
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
fib = (n)-> | |
return ((n,a,b) -> | |
if n>0 then arguments.callee n-1, b, a+b else a | |
)(n,0,1) |
OlderNewer