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
/// <reference path='../../../tools/vue/vue.0.10.0RC.d.ts'/> | |
var Router:any; | |
module app{ | |
export module sorting{ | |
export var ALL = 'all'; | |
export var ACTIVE = 'active'; | |
export var COMPLETED = 'completed'; |
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 ( | |
"math/rand" | |
"net" | |
"github.com/cryptix/goremutake" | |
"github.com/ftrvxmtrx/fd" | |
) |
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
#!/bin/bash | |
# Rafal Jeczalik <rjeczalik@gmail.com> | |
# https://gist.github.com/rjeczalik/db886c79049d83f318e2 | |
type curl 1>/dev/null || exit | |
type jq 1>/dev/null || exit | |
die_usage() { | |
if [ ! -z "${*}" ]; then |
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
// Use Case: | |
// | |
// Say you have a bunch of decoupled components which access the same set of databases. | |
// Since database/sql does connection pooling it makes sense for the components to share instances of *sql.DB | |
// This package lets you do that with minimal code changes. | |
package dbmanager | |
import ( | |
"database/sql" | |
"time" |
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
type FbVal is (U64, (String|None)) | |
type FbNext is (FbActor | None) | |
actor FbActor | |
var _env : Env | |
var _mod : U64 | |
var _word : String | |
var _next : FbNext | |
new create(env: Env, mod: U64, word : String, next: FbNext = None) => |
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 dropbox | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io" | |
"net/http" | |
"net/url" | |
"strconv" |
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" | |
"fmt" | |
"github.com/gorilla/sessions" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
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 "fmt" | |
type Foo struct{} | |
func (f *Foo) Method() { | |
fmt.Println("Method") | |
} | |
type Funcs []func(*Foo) |
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
// utilizes the browser eventsystem | |
// usefull in cases where you need communication between independent components | |
// registered events are automatically removed onunload with preserving any other onunload handler | |
var eventsMixin = function(target) { | |
var _subscriptions = []; | |
target.broadcast = function(type, payload) { | |
var ev = new CustomEvent(type, { | |
detail: payload, |
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
# Put this in ~/.bash_profile | |
# https://gist.github.com/disq/42459b522836b25f30469b3acb5500bf | |
gcd() { | |
if [[ "$1" == "" || "$2" != "" ]]; then | |
echo "Usage: gcd <dir in gopath>" | |
return 1 | |
fi | |
FINDIN=${GOPATH}/src |
OlderNewer