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 repo | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
type Repo struct { | |
// The path of the Repoisotry. This could be |
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 repo | |
import ( | |
"testing" | |
) | |
func BenchmarkIsRemote(b *testing.B) { | |
repos := []Repo{ | |
{Path: "git://github.com/foo/far"}, | |
{Path: "git://github.com/foo/far.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
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
type Message struct { |
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 ( | |
"database/sql" | |
"log" | |
_ "github.com/lib/pq" | |
) | |
func connect(driver string, credentials string) *sql.DB { |
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 ( | |
"log" | |
"sync" | |
"time" | |
) | |
// Global wait group | |
var jobs sync.WaitGroup |
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
# Description: | |
# Get the top news item from HN | |
# | |
# Commands: | |
# hubot hn - Return the top item on HN | |
module.exports = (robot) -> | |
robot.respond /hn( me)?$/i, (msg) -> | |
story = hnTopStory(msg) | |
console.log story |
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
# Plotting the Gamma distribution and sample as a normalize histogram | |
using Distributions | |
using Gadfly | |
pdf(d::Gamma, x) = (x ^ (d.α - 1) * e ^ (-x / d.α)) / (d.θ ^ d.α * gamma(d.α)) | |
n = 500 | |
g = Gamma(2., 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
#!/usr/bin/env python | |
# vim: ts=4:sw=4:expandtab:autoindent: | |
import os | |
import sys | |
import requests | |
import filecmp | |
from fabric.context_managers import hide, settings, prefix | |
from fabric.api import sudo, task, run, cd, env | |
from fabric.contrib.console import confirm | |
from fabric.colors import green |
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 "database/sql" | |
import "log" | |
import _ "github.com/lib/pq" | |
func main() { | |
conn, err := sql.Open("postgres", "user=aaronoellis dbname=bar sslmode=disable") | |
if err != nil { | |
log.Fatal(err) |
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 ( | |
"database/sql" | |
"encoding/json" | |
"log" | |
"net/http" | |
"os" | |
"time" |
OlderNewer