Skip to content

Instantly share code, notes, and snippets.

View metakeule's full-sized avatar
💭
I may be slow to respond.

metakeule metakeule

💭
I may be slow to respond.
  • Asunción / Paraguay
View GitHub Profile
@diverted247
diverted247 / app.ts
Created March 21, 2014 16:48
TypeScript + VueJS - Module Path Attempt
/// <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';
@cryptix
cryptix / client.go
Created July 30, 2014 11:45
sharing filedescriptors through unix sockets
package main
import (
"math/rand"
"net"
"github.com/cryptix/goremutake"
"github.com/ftrvxmtrx/fd"
)
@rjeczalik
rjeczalik / gh-gopath
Last active August 29, 2015 14:08
Imports all Go projects from your GitHub account into a GOPATH workspace
#!/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
// 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"
@timyates
timyates / fizzbuzz.pony
Last active August 29, 2015 14:20
First go at FizzBuzz in pony-lang
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) =>
anonymous
anonymous / db.go
Created January 24, 2012 17:39
Go SDK for Dropbox
package dropbox
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
@minikomi
minikomi / persona.go
Last active December 11, 2015 06:59
mozilla persona test
package main
import (
"encoding/json"
"fmt"
"github.com/gorilla/sessions"
"io/ioutil"
"log"
"net/http"
"net/url"
@metakeule
metakeule / gist:4623836
Created January 24, 2013 16:02
combine methods and functions that have the same primary argument, i.e. handle methods that are defined with the object and functions that are defined afterwards for this object (in another library) the same way.
package main
import "fmt"
type Foo struct{}
func (f *Foo) Method() {
fmt.Println("Method")
}
type Funcs []func(*Foo)
@webcss
webcss / eventsmixin.js
Last active August 9, 2016 12:44
PubSub mixin using CustomEvents
// 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,
@disq
disq / gcd.sh
Last active January 2, 2017 07:46
gcd: cd in GOPATH
# 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