Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| # If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
| export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
| # This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
| # ~/code/web:beta_directory$ git checkout master | |
| # Switched to branch "master" | |
| # ~/code/web:master$ git checkout beta_directory | |
| # Switched to branch "beta_directory" |
| ;------------------------------------------------------------------------------ | |
| ; Disable Insert key | |
| ;------------------------------------------------------------------------------ | |
| $Insert::return | |
| !Insert::Send, {Insert} ; Use Alt+Insert to toggle the 'Insert mode' | |
| ;------------------------------------------------------------------------------ | |
| ; Hand tool with middle button in Adobe Reader | |
| ;------------------------------------------------------------------------------ | |
| #IfWinActive ahk_class AdobeAcrobat |
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
| #!/usr/bin/python | |
| import subprocess | |
| import re | |
| from optparse import OptionParser | |
| def git_version(): | |
| p = subprocess.Popen(["git", "log" , '-1', '--date=iso'], stdout=subprocess.PIPE) | |
| out, err = p.communicate() | |
| m = re.search('\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}', out) |
| { | |
| "cmd" : ["$file"], | |
| "selector" : "source.shell", | |
| "shell" : "bash" | |
| } |
| /* | |
| * Euler's totient function phi(n). | |
| * http://en.wikipedia.org/wiki/Euler%27s_totient_function | |
| * | |
| * This is an *EXTREMELY* fast function and uses | |
| * several tricks to recurse. | |
| * | |
| * It assumes you have a list of primes and a fast | |
| * isprime() function. Typically, you use a bitset | |
| * to implement the sieve of Eratosthenes and use |
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream