Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kjunggithub
kjunggithub / gist:62d384641b1fac47ca70
Created April 30, 2015 17:18
Cut video clip by time without encoding
ffmpeg -y -i input.mkv -vcodec copy -acodec copy -ss 00:10:05 -t 30 output.mkvs
<?php
class ApiController extends \BaseController {
// extend apicontroller from homecontroller
//
// build functions for 400, 403, 500, and other ones that we may use
// return errors with:
// $this->respondNotFound('blah blah cant be found');
//
// return success with:
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
#!/bin/bash
# vim:set ts=4 sw=4 et ai:
# Retrieve SSH public keys from GitHub and install to authorized_keys.
GITHUB_USERS=(USER1 USER2)
INSTALL_FILE=/home/USER/.ssh/authorized_keys
TMP_KEY=/tmp/ssh.key
CURL=/usr/bin/curl
CURLOPTS="--retry 3 --retry-delay 2 --silent --fail -o $TMP_KEY"
<?php
/*
* This file is part of HTMLPurifier Bundle.
* (c) 2012 Maxime Dizerens
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@kjunggithub
kjunggithub / gist:dbf31d33aa8fc72c180f
Created May 15, 2014 17:27
start ngrok with subdomain
$ ngrok -subdomain=example 80
error: function(jqXHR, textStatus, errorThrown) {
console.log('=============');
console.log(arguments);
alert('HTTP Error: '+errorThrown+' | Error Message: '+textStatus);
console.log('=============');
},

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: