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
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
unbind p | |
bind p paste-buffer | |
bind -T copy-mode-vi 'v' send -X begin-selection | |
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle | |
# Pre-tmux 2.3 vi bindings | |
#bind-key -t vi-copy 'v' begin-selection |
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
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
unbind p | |
bind p paste-buffer | |
bind -T copy-mode-vi 'v' send -X begin-selection | |
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle | |
# Pre-tmux 2.3 vi bindings | |
#bind-key -t vi-copy 'v' begin-selection |
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
package main | |
import "fmt" | |
func main() { | |
for i := 1 ; i <= 100 ; i++ { | |
if i % 15 == 0 { | |
fmt.Println("FizzBuzz") | |
} else if i % 5 == 0 { | |
fmt.Println("Buzz") |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
function git_unadded_new { | |
if git rev-parse --is-inside-work-tree &> /dev/null | |
then | |
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] | |
then | |
echo "" |
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
$ curl -I http://microsoft.com | |
HTTP/1.1 301 Moved Permanently | |
Content-Length: 148 | |
Content-Type: text/html; charset=UTF-8 | |
Location: http://www.microsoft.com/ | |
Server: Microsoft-IIS/7.5 | |
P3P: CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI" | |
X-Powered-By: ASP.NET | |
X-UA-Compatible: IE=EmulateIE7 | |
Date: Thu, 26 Sep 2013 20:16:47 GMT |
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
$ curl -I http://www.hireright.com/Data-Security.aspx | |
HTTP/1.1 200 OK | |
Cache-Control: private | |
Content-Length: 19625 | |
Content-Type: text/html; charset=utf-8 | |
Server: Microsoft-IIS/7.5 | |
Set-Cookie: ASP.NET_SessionId=tn0hxauue4ksp155tfvwwm55; path=/; HttpOnly | |
X-AspNet-Version: 2.0.50727 | |
X-Powered-By: ASP.NET | |
Date: Thu, 26 Sep 2013 19:55:51 GMT |
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
conn = new Mongo(); | |
dblist = conn.getDBs(); | |
dblist.databases.forEach(function(x){ | |
db = db.getSiblingDB(x.name); | |
db.getCollectionNames().forEach(function(c){ | |
printjson(db.getCollection(c).validate()) | |
}) | |
}) |
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 | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
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 <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
//Sort an array A using insertion sort. Notice it is to be passed by reference. | |
void sort(int* A, int n){ | |
int tmp; | |
int i; | |
int j; |
NewerOlder