$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
This file contains hidden or 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
import pandas as pd | |
import numpy as np | |
from sklearn.metrics.pairwise import cosine_similarity | |
df = pd.read_csv("data/beer_reviews.csv") | |
# let's limit things to the top 250 | |
n = 250 | |
top_n = df.beer_name.value_counts().index[:n] | |
df = df[df.beer_name.isin(top_n)] |
This file contains hidden or 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 is a Gist to try to help you understand go pointers. | |
// You can run it in an interactive environment over on the go | |
// playground at: http://play.golang.org/p/pYTsfo6uhz | |
package main | |
import ( | |
"fmt" | |
) |
This file contains hidden or 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
import re, collections | |
def words(text): return re.findall('[a-z]+', text.lower()) | |
def train(features): | |
model = collections.defaultdict(lambda: 1) | |
for f in features: | |
model[f] += 1 | |
return model |
This file contains hidden or 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
FROM ubuntu:12.04 | |
RUN apt-get update | |
RUN apt-get install -y wget | |
RUN apt-get install -y curl | |
RUN curl -L https://github.com/EricChiang/pup/releases/download/0.1.1/pup_linux_386 > pup | |
RUN chmod +x /pup | |
RUN wget http://www.pro-football-reference.com/years/2013/games.htm | |
RUN /pup < games.htm table#games 'a[href*=boxscores]' attr{href} |
This file contains hidden or 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
#!/bin/bash | |
env X="() { :;} ; echo shellshock" /bin/sh -c "echo completed" | |
env X="() { :;} ; echo shellshock" `which bash` -c "echo completed" | |
sudo apt-get update | |
# for /bin/bash | |
sudo apt-get upgrade -y bash |
This file contains hidden or 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" | |
"io" | |
"log" | |
"net/http" | |
"code.google.com/p/go.net/html" | |
) |
This file contains hidden or 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
import sys | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "Hello World!" | |
if __name__ == "__main__": |
This file contains hidden or 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
# List all non-standard Go depencencies as a tree. | |
function gotree() { | |
level=${2:-'0'} | |
for package in `goimports $1`; do | |
printf "%${level}s$package\n" | |
gotree $package $[$level+2] | |
level=$[$level-2] | |
done | |
} |
This file contains hidden or 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
import types | |
import warnings | |
def lookup(obj): | |
"""Take a python object or class and determine the module it's imported | |
from and the version of that module. | |
""" | |
if type(obj) == types.ModuleType: | |
try: | |
module = obj.__name__ |
OlderNewer