Skip to content

Instantly share code, notes, and snippets.

View jpillora's full-sized avatar
👶

Jaime Pillora jpillora

👶
View GitHub Profile
@jpillora
jpillora / combine-through.js
Created May 5, 2014 01:56
Combine 'through' streams
// combine an existing pipeline:
// entry -> s1 -> s2 -> s3 -> s4 -> exit
// into:
// P
// where sX -> P => sX -> entry
// and P -> sY => exit -> sY
var combine = function(entry, exit) {
//simple proxy stream
var combination = through();
@jpillora
jpillora / line-graph.html
Created May 30, 2014 10:24
Line Graph with D3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #000;
@jpillora
jpillora / keybase.md
Created July 16, 2014 13:59
keybase.md

Keybase proof

I hereby claim:

  • I am jpillora on github.
  • I am jpillora (https://keybase.io/jpillora) on keybase.
  • I have a public key whose fingerprint is 76E4 EC44 A889 E24C EF63 CB20 FBE6 99A2 4DBB 8F37

To claim this, I am signing this object:

@jpillora
jpillora / flex.styl
Created September 17, 2014 07:56
Nib (Stylus) Flex Example
.flex
display(flex)
flex-direction(normal)
flex-direction(row)
flex-wrap(wrap)
justify-content(start)
align-content(stretch)
.item
@jpillora
jpillora / through.js
Created January 22, 2015 18:29
Through stream
var stream = require('stream');
var Transform = stream.Transform;
module.exports = function through(opts, transform, flush) {
//use default options
if (typeof opts !== 'object') {
flush = transform;
transform = opts;
opts = {
@jpillora
jpillora / class.sublime-snippet
Last active August 29, 2015 14:16
Sublime Auto-Complete Snippet - Go Class (Golang)
<snippet>
<name>Class</name>
<tabTrigger>class</tabTrigger>
<content><![CDATA[//${1:ClassName} is ${3:...}
type ${1:ClassName} struct {
${2}
}
//New${1:ClassName} creates a new ${1:ClassName}
func New${1:ClassName}(${2/\t?(\w+) ([\.\w\*]+)(\n)?/\l$1 $2,/mg}) *${1:ClassName} {
@jpillora
jpillora / README.md
Last active August 29, 2015 14:18
RethinkDB CoreOS Service

Load services

fleetctl submit rethinkdb-discovery@.service
fleetctl submit rethinkdb@.service

Start 3

#env
set -x GOPATH $HOME/go
set -x PATH $GOPATH/bin /usr/local/go/bin $PATH
#fish
set fish_greeting ""
function fish_prompt
set_color $fish_color_cwd
echo -n yournamehere
@jpillora
jpillora / simple-templating.go
Created May 16, 2015 06:10
Simple Templating in Go
package main
import (
"fmt"
"regexp"
)
func main() {
str := "my string and {{ foo }} and {{bar}}!"
str = template(str, map[string]string{"foo": "1", "bar": "2"})
@jpillora
jpillora / gitlab-docker.sh
Last active August 29, 2015 14:22
Gitlab Docker setup
#gitlab requires postgres and redis
#all 3 containers store their data in /opt
#the only variables that really need to be set
#are: GITLAB_HOST and GITLAB_ROOT_PASSWORD
mkdir -p /opt/postgresql/data
docker run --name 'postgresql-gitlab' \
-d \
-e 'DB_USER=gitlab_user' \
-e 'DB_PASS=gitlab_pass' \