git fetch <remote>
git checkout -b <branch> --track <remote>/<branch>
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
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
#! /usr/bin/env bash | |
# Loading the RVM Environment files. | |
source /Users/dlite/.rvm/environments/ruby-1.9.2-p290 | |
# Changing directories to your rails project. | |
cd /Users/dlite/projects/my_rails_app | |
# Call Scout and pass your unique key. | |
bundle exec scout [KEY] |
<?php | |
namespace Nrk\Predis; | |
use Nrk\Predis\Connection\MasterSlaveWrapperConnection; | |
use Predis\Cluster\Distribution\HashRing; | |
use Predis\Connection\PredisCluster; | |
use Predis\Option\ClientOptions; | |
class MasterSlaveClusterInitializer |
(MSIE|(?!Gecko.+)Firefox|(?!AppleWebKit.+Chrome.+)Safari|(?!AppleWebKit.+)Chrome|AppleWebKit(?!.+Chrome|.+Safari)|Gecko(?!.+Firefox))(?: |\/)([\d\.apre]+)
This regular expression is capable of retrieving the browser and version for the following browsers;
- Internet Explorer
- Firefox (INCLUDING alpha and "pre" versions)
- Other browsers reporting a "Gecko" version in their user agent
- Chrome
- Safari
- Other browsers reporting an "AppleWebKit" version in their user agent
<?php | |
/* | |
* Script: DataTables server-side script for PHP and MySQL | |
* Copyright: 2012 - John Becker, Beckersoft, Inc. | |
* Copyright: 2010 - Allan Jardine | |
* License: GPL v2 or BSD (3-point) | |
*/ | |
class TableData { |
Run the two commands below one at a time to get Samba 3 installed and to have it run on boot.
Install Samba with Homebrew
sh < <(curl https://raw.github.com/gist/1938575/df254d9a2ac83dddb04fcc7f9b634b65708aa477/
<?php | |
namespace Silex\Provider; | |
use Silex\Application; | |
use Silex\SilexEvents; | |
use Silex\ControllerProviderInterface; | |
use Silex\ControllerCollection; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |