In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
app.use(express.methodOverride()); | |
// ## CORS middleware | |
// | |
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs | |
var allowCrossDomain = function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); | |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
# From https://raw.github.com/chrishunt/dot-files/master/.tmux.conf | |
########################### | |
# Configuration | |
########################### | |
#use 256 term for pretty colors | |
set -g default-terminal "screen-256color" | |
# increase scroll-back history | |
set -g history-limit 5000 |
var express = require('express'); | |
var cookieParser = require('cookie-parser'); | |
var session = require('express-session'); | |
var flash = require('express-flash'); | |
var handlebars = require('express-handlebars') | |
var app = express(); | |
var sessionStore = new session.MemoryStore; | |
// View Engines |
#!/usr/bin/env bash | |
set -e | |
# allow being run from somewhere other than the git rootdir | |
gitroot=$(git rev-parse --show-cdup) | |
# default gitroot to . if we're already at the rootdir | |
gitroot=${gitroot:-.}; | |
nm_bin=$gitroot/node_modules/.bin |
This guide assumes you have the emmet
and language-babel
packages already installed in Atom
keymap.cson
file by clicking on Atom -> Keymap…
in the menu bar'atom-text-editor[data-grammar~="jsx"]:not([mini])':
This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:
(async main(){...}())
as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problemsI'll leave the rest of this document unedited, for archaeological
import { createElement, DOM } from 'react' | |
import compose from 'recompose/compose' | |
import withHandlers from 'recompose/withHandlers' | |
import withReducer from 'recompose/withReducer' | |
import DropZone from 'react-dropzone' | |
import { StyleSheet, css } from 'aphrodite/no-important' | |
import { animation, colors, commonStyles, font } from 'style' | |
import Icon from 'art/Icon' | |
const { div } = DOM |