$ 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!
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) |
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, |
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) |
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 | |
} |
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[]) | |
{ |
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 &); | |
} |
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 |
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 |
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