Skip to content

Instantly share code, notes, and snippets.

View mattatcha's full-sized avatar

Matt Aitchison mattatcha

View GitHub Profile
@brigand
brigand / git.md
Created October 6, 2014 02:50
My Git Aliases

I use git a lot for work and other projects, so I invested the time in creating some high quality aliases that really work for me. These just go in your bash profile (~/.bash_profile or ~/.bashrc or ~/.profile depending on your OS).

I see a lot of people go overboard with aliases, and then end up not using them. They're meant to cover 95% of the commands I use, not 100%.

alias gcam='git commit -am'
alias gs='git status'
alias gplr='git pull --rebase'
alias gpsh='git push'
alias gpo='git push -u origin `git symbolic-ref --short HEAD`'
@alexissantos
alexissantos / gist:f3604ef520a0d4395fe5
Last active August 29, 2015 14:06
This is your chance to ask RethinkDB's founder a question
Aloha, /r/Programming!
Tomorrow, I'm interviewing RethinkDB's founder, Slava Akhmechet, for a podcast. Have any questions for him?
Comment here or on Reddit and I'll ask him!
There'll be a full text transcript of the interview posted next week, too, for those who aren't fond of podcasts.
Thanks!
-Alexis
@cryptix
cryptix / vineScrape.go
Created August 27, 2014 12:31
extract a javascript object value from a html page using goquery and otto
package main
import (
"errors"
"log"
"os"
"github.com/PuerkitoBio/goquery"
"github.com/robertkrimen/otto"
)
package main
import (
"fmt"
"log"
"net/http"
"html/template"
"github.com/gorilla/sessions"
@mikedugan
mikedugan / gulpfile.js
Created June 23, 2014 01:44
Basic gulpfile setup to minify images, LESS/CSS, and JS
var gulp = require('gulp');
var rimraf = require('rimraf');
var less = require('gulp-less');
var concat = require('gulp-concat');
var prefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var jsmin = require('gulp-uglify');
var watch = require('gulp-watch');
var util = require('gulp-util');
var rename = require('gulp-rename');
th span {
width: 2em;
display: inline-block;
}
@progrium
progrium / codep
Last active July 23, 2018 20:33
Creates a co-dependent process cluster, the first half of a "one for all" supervision strategy
#!/bin/bash
codep() {
set -eo monitor
trap 'kill $(jobs -p) &> /dev/null' EXIT
trap 'exit 2' CHLD
for child in "$@"; do
$child &
done
wait

BoardMVC

Note: this is a draft. The rules and requirements will be finalized on July 1st 2014.

You may have seen TodoMVC which shows the same todo list, created with many different frameworks and libraries.

It's very helpful, but people often find it lacking in common requirements for a web app. It doesn't handle users, persistence, reusable components, modals, AJAX, etc.

@elithrar
elithrar / use.go
Last active April 3, 2025 18:10
go/use: Little middleware chains that could. Inspired by comments here: https://github.com/gorilla/mux/pull/36
r := mux.NewRouter()
// Single handler
r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging)
// All handlers
http.Handle("/", recovery(r))
// Sub-routers
apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json}
@pk11
pk11 / reactjs.js
Last active August 29, 2016 17:42
/** @jsx React.DOM */
/**
* Our component structure will look like the following:
* - WikiBox
* -- AutoCompleteBox
* --- AutoComplete
*/
// this component renders a single entity coming from wikipedia