Skip to content

Instantly share code, notes, and snippets.

Beautiful Canoe Summer Fellowships 2020

Sarah Mount snim2

Beautiful Canoe Summer Fellowships 2020
View GitHub Profile

Creating the post-commit file

Note: If you want to use your personal Twitter account to post commits, go to Step 2

  1. Create a new Twitter account for your commit messages. Example
  2. Go to and Sign In with your Twitter account you are posting commit messages to.
  3. Hover over your username in the top-right corner after signing in and select "My Applications"
  4. Create a new application
  5. The name, description, and site can all be whatever you want, but leave Callback URL empty
  6. Under "Application Settings" click "modify app permissions" next to "Access level"
# Usage Example: $ clone-github github_id
# would clone all the git repositories managed under github_id at current path
# save it as /etc/profiles/
repos=`curl -skL $GITHUB_REPO_URI | grep 'title="Forks"' | sed "s/.*$GITHUB_ID\///" | sed 's/\/network"\stitle="Forks">//'`
View pdfstill
outfn=`basename $infn .pdf`.still.pdf
# Embed fonts.
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfn \
-dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -c .setpdfwrite -f $infn
# Strip metadata crap added by Ghostscript.
exiftool -Title="" $outfn

Want to push to two Git Repos via a single command?

Want to do it easily via a simple .git edit?

My use case is pushing code that resides on Github as well as on Bitbucket. I want it available in both remote locations in case one is unavailable.

Here's how you do it:

Add the two remotes as normal

View gist:8639969
branch_mapping = [('default', 'master')]
target = "git+ssh://"
repo = hgapi.Repo(path)
for hgb, gb in branch_mapping:
repo.hg_command('bookmark', '-r', hgb, gb)
repo.hg_command("--config", "paths.default=" + target, "--config", "extensions.hggit=", "push")
case "$1" in
/usr/local/bin/vim "$1"
*.md )
/usr/local/bin/mmdc "$1"
*.txt )
snim2 / Python Notepad Bookmarklet
Last active Dec 11, 2015 — forked from jakeonrails/Ruby Notepad Bookmarklet
Stick this in the URL bar of a browser to open up an in-browser syntax highlighted text editor
View Python Notepad Bookmarklet
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/Cobalt");e.getSession().setMode("ace/mode/python");</script>
You can’t perform that action at this time.