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
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
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 ( | |
"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 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 repo | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
type Repo struct { | |
// The path of the Repoisotry. This could be |
NewerOlder