Create an empty git repo or reinitialize an existing one
git init
#directory stuff | |
alias la='ls -a' | |
alias ll='ls -l' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias .....='cd ../../../..' | |
alias ......='cd ../../../../..' | |
alias .......='cd ../../../../../..' | |
alias ~='cd ~' |
#!/bin/sh | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} | |
}); |
Create an empty git repo or reinitialize an existing one
git init
// assumes you add a timestamp field to each record (see Firebase.ServerValue.TIMESTAMP) | |
// pros: fast and done server-side (less bandwidth, faster response), simple | |
// cons: a few bytes on each record for the timestamp | |
var ref = new Firebase(...); | |
ref.orderByChild('timestamp').startAt(Date.now()).on('child_added', function(snapshot) { | |
console.log('new record', snap.key()); | |
}); |
Press minus + shift + s
and return
to chop/fold long lines!
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc
/******************************************************************************* | |
1. DEPENDENCIES | |
*******************************************************************************/ | |
var gulp = require('gulp'); // gulp core | |
sass = require('gulp-sass'), // sass compiler | |
uglify = require('gulp-uglify'), // uglifies the js | |
jshint = require('gulp-jshint'), // check if js is ok | |
rename = require("gulp-rename"); // rename files | |
concat = require('gulp-concat'), // concatinate js |