Skip to content

Instantly share code, notes, and snippets.

View thiagocaiubi's full-sized avatar
😄

Thiago Caiubi thiagocaiubi

😄
View GitHub Profile
@thiagocaiubi
thiagocaiubi / object-shorthand.js
Last active July 5, 2016 11:38
Object function shorthand
const a = {
b() {}
};
@thiagocaiubi
thiagocaiubi / .gitignore
Last active April 4, 2016 17:15
Map vs Object benchmark
node_modules
'use strict';
const Car = function() {};
Car.prototype.move = function() {
console.log('moving');
};
class Fusca extends Car {
move() {
@thiagocaiubi
thiagocaiubi / main.go
Created December 2, 2015 18:37 — forked from danesparza/negroni-gorilla.go
Negroni with Gorilla mux subrouter
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
)
@thiagocaiubi
thiagocaiubi / tail.sh
Created October 30, 2015 18:24
tail grep and do what you want
tail -fn0 logfile | \
while read line ; do
echo "$line" | grep "pattern"
if [ $? = 0 ]
then
... do something ...
fi
done
@thiagocaiubi
thiagocaiubi / vim.md
Last active October 9, 2015 16:14
vim cheat sheet

Marking text

Enter VISUAL MODE first

aw word
ab block with ()
aB block with {}
ib inner block with ()
iB inner block with {}

@thiagocaiubi
thiagocaiubi / API.md
Last active August 29, 2015 14:26 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

#to add network restriction
sudo tc qdisc add dev lo root netem delay 100ms
#to remove it network restriction
sudo tc qdisc del dev lo root netem delay 100ms
@thiagocaiubi
thiagocaiubi / gist:4383812
Created December 26, 2012 23:04
git diffmerge tool
git config --global merge.tool diffmerge
git config --global mergetool.diffmerge.cmd "diffmerge --merge
--result=\$MERGED \$LOCAL \$BASE \$REMOTE"
git config --global mergetool.diffmerge.trustExitCode true