Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
/** | |
* Requires node v0.7.7 or greater. | |
* | |
* To connect: $ curl -sSNT. localhost:8000 | |
*/ | |
var http = require('http') | |
, repl = require('repl') | |
, buf0 = new Buffer([0]) |
// You can test this online at: https://play.golang.org/p/hhayRT1VWgj | |
package main | |
import ( | |
"crypto/sha1" | |
"encoding/hex" | |
"fmt" | |
"io" | |
"strings" | |
) |
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
// to run: node node-base64-encode.js file | |
const mime = require('mime'); // npm install mime | |
const path = require('path'); | |
const fs = require('fs'); | |
// path to the file we passed in | |
const filepath = path.resolve(process.argv[2]); | |
// get the mimetype | |
const filemime = mime.getType(filepath); |
Unzip and move to /opt
Create symlink
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh | |
# Aliases | |
alias g='git' | |
#compdef g=git | |
alias gst='git status' | |
#compdef _git gst=git-status | |
alias gd='git diff' | |
#compdef _git gd=git-diff | |
alias gdc='git diff --cached' |
abbr g git | |
abbr ga 'git add' | |
abbr gaa 'git add --all' | |
abbr gb 'git branch' | |
abbr gbda git\ branch\ --merged\ \|\ command\ grep\ -vE\ \"\^\(\\\*\|\\s\*master\\s\*\\\$\)\"\ \|\ command\ xargs\ -n\ 1\ git\ branch\ -d | |
abbr gbnm 'git branch --no-merged' | |
abbr gbr 'git branch --remote' | |
abbr gc 'git commit -v' | |
abbr gc! 'git commit -v --amend' | |
abbr gca 'git commit -v -a' |
/** | |
* call wrapper function is equal to use call/apply to invoke function | |
* see follow usage | |
* | |
* @param {Function} f - need to wrapper function | |
*/ | |
var uncurryThis = function(f) { | |
var call = Function.call; | |
return function() { | |
return call.apply(f, arguments); |
#!/bin/bash | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Original Source: | |
# https://gist.github.com/ggrandes/c1765904e804db15b8c57d90299d006f | |
# |