Skip to content

Instantly share code, notes, and snippets.

View bergantine's full-sized avatar

J*Bergantine bergantine

  • London, United Kingdom
View GitHub Profile
@bergantine
bergantine / prompt.sh
Last active December 27, 2015 17:39 — forked from roychri/prompt.sh
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=
@bergantine
bergantine / gist:4742424
Last active December 12, 2015 08:09 — forked from murtaugh/1. single-line.html
Blockquote semantics enhanced by figure. #html #html5 #figure #happycog
Single line, no attribution:
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
Single line, with attribution and optional cite:
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
@bergantine
bergantine / gist:4487752
Last active September 6, 2020 22:39 — forked from dhc02/gist:4487729
Concatenate files in a directory into a single file. #ruby #donnieclapp
# Iterates over files and subdirectories in directorie[s] given as arguments
# and adds raw text of those files to merged.txt in the working directory
# where the script is called
# Call like this:
# ruby merge.rb {absolute path portion to delete} {directory to scan} [{directory to scan}]
# For example:
# ruby merge.rb /Users/donnieclapp/Projects/ ~/Projects/htl-website/myproject/static_media/stylesheets
# create or open the merged.txt file for writing (in working directory)
@bergantine
bergantine / prompt.sh
Created November 7, 2012 20:15 — forked from tobiassjosten/prompt.sh
Bash Prompt with Git. #bash #shell
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[0;32m\]'
c_path='\[\e[1;34m\]'
c_git_clean='\[\e[0;37m\]'
c_git_staged='\[\e[0;32m\]'
c_git_unstaged='\[\e[0;31m\]'
else
c_reset=
@bergantine
bergantine / post-merge
Created September 18, 2012 18:55 — forked from robhudson/post-merge
post-merge Git hook to look for changes to requirements. #bash #git #hook #pip #python
#!/bin/sh
if [ $(git diff HEAD@{1} HEAD --name-only | grep 'requirements/' -c) -ne 0 ]
then
$VIRTUAL_ENV/bin/pip install -r requirements/dev.txt
fi
@bergantine
bergantine / postactivate
Created September 10, 2012 20:52 — forked from carljm/postactivate
Git hooks to activate a ruby gem environment. #git #hook #ruby #gem #bash
#!/bin/bash
# This hook is run after every virtualenv is activated.
export OLD_GEM_HOME=$GEM_HOME
export GEM_HOME=$VIRTUAL_ENV/gems/
export GEM_PATH=
export PATH=$VIRTUAL_ENV/gems/bin:$PATH
@bergantine
bergantine / projectAppDelegate.m
Created March 13, 2012 18:51 — forked from mwbrooks/projectAppDelegate.m
In PhoneGap-iOS, open external links in the external browser (Safari.app). #ios #objectivec #phonegap
/**
* Note: the following function should already exist in your application delegate file.
* Replace it with the following implementation.
*
* Thanks to @purplecabbage for implementation.
*/
// ...
/**