$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
View dustbin.r
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
# author - @edbidangi | |
# https://twitter.com/edbidangi/status/550997127074045952 | |
library(rgl) | |
dist <- function(x1, y1, x2, y2) { | |
return(sqrt( (x2 - x1)**2 + (y2 - y1)**2 )) | |
} | |
width = 20 | |
height = 20 | |
distances = matrix(nrow = height, ncol = width) |
View postgresql-inspect-table-sizes.txt
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
-- Display table and index sizes | |
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size | |
FROM ( | |
SELECT | |
table_name, | |
pg_table_size(table_name) AS table_size, |
View auth.go
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 ( | |
"encoding/base64" | |
"net/http" | |
"strings" | |
) | |
type handler func(w http.ResponseWriter, r *http.Request) |
View pointers.go
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
// pointer dereference - differences | |
package main | |
import "fmt" | |
type User struct { | |
name string | |
email string | |
} |
View gist:e433b91d16867b48bfd6
View helloworld.cpp
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
// This file is a part of 'helloworld' project | |
// Copyright (c) 2012 by Sandeep Raju <sandeeprajup@gmail.com> | |
// Title : Program to print 'hello, world' | |
// Created : 20.06.2012 | Wednesday | |
// Author : Sandeep Raju <sandeeprajup@gmail.com> | |
#include <iostream> | |
int main(int argc, char* argv[]) | |
{ |
View sublime_function.sh
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 sublime() | |
{ | |
(/location/of/sublimetext2/folder/sublime_text "$@" > /dev/null 2> /dev/null &); | |
} |
View distribution.py
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/python | |
import pylab | |
import random | |
import math | |
def uniform(): | |
result = {} | |
hist = [] | |
a = 100 |
View saytime.py
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 | |
# -*- coding: utf-8 -*- | |
import time | |
import os | |
def main(): | |
baseStr = "'The time is, " | |
currentTime = time.localtime() | |
currentHour = currentTime.tm_hour |
View checksum.py
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 sys | |
import hashlib | |
import pprint | |
def getSHA1(path): | |
sha1 = hashlib.sha1() |
OlderNewer