Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Charity benjamincharity

View GitHub Profile
@benjamincharity
benjamincharity / HTML5 in older IE
Created Mar 14, 2012
This snippet enables HTML5 elements in older versions of IE
View HTML5 in older IE
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
View .gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@benjamincharity
benjamincharity / Faster Touch Links
Created Apr 26, 2012
Use touchend to get faster links on touch devices
View Faster Touch Links
@benjamincharity
benjamincharity / smooscroll.js
Created May 9, 2012 — forked from cange/smooscroll.js
Simple smooth scrolling solution
View smooscroll.js
// <a rel="smoothscroll" href="#foo">got to foo</a>
// <div id="foo">Foo content</div>
$(function () {
$('a[rel=smoothscroll]').click(function( event ) {
var location = window.location,
hash = $(this).attr('href')
;
$('html, body')
.stop()
.animate({scrollTop: $(hash).offset().top}, 800, function () {
@benjamincharity
benjamincharity / githubcliauthissues
Last active May 15, 2017
Fix the github auth issue where it asks for permissions every push/pull.
View githubcliauthissues
// Step 1.
// this returns some useful information which will help you fill out the next command.
// look for the line that begins with "remote.origin.url".
$ git config -l
// Step 2.
// use the information from step one to replace 'your_username' and 'your_project'.
$ git config remote.origin.url git@github.com:your_username/your_project.git
View Alfred Spotify Applescript
on alfred_script(q)
tell application "System Events"
set MyList to (name of every process)
end tell
if (MyList contains "Spotify") is true then
if (q equals "p") then
tell application "Spotify" to play
else if (q equals "pp") then
tell application "Spotify" to pause
else if (q equals "t") then
@benjamincharity
benjamincharity / createProjectShellScript
Last active Oct 9, 2015
A simple shell script for Alfred that creates a new project and updates all dependancies with 'create exampleName'.
View createProjectShellScript
# Cd into my projects directory
cd ~/dropbox/freelance/projects/
# Create a new folder using the query
mkdir {query}
# Clone the boilerplate into this new directory
git clone https://github.com/benjamincharity/mm-boilerplate.git {query}
# Cd into the project
@benjamincharity
benjamincharity / restartPausedOSXProcess
Created Sep 10, 2012
Restart a paused OSX process by killing it via the command line.
View restartPausedOSXProcess
$ ps -ax | grep Photoshop
## change 12345 to the PID number returned with the first command.
$ kill -CONT 12345
@benjamincharity
benjamincharity / dabblet.css
Created Nov 7, 2012
CSS Border with Box-Shadow Example
View dabblet.css
/**
* CSS Border with Box-Shadow Example
*/
div {
/* Borders */
box-shadow: 0 0 0 6px rgba(0,0,0,0.2), 0 0 0 12px rgba(0,0,0,0.2), 0 0 0 18px rgba(0,0,0,0.2), 0 0 0 24px rgba(0,0,0,0.2);
/* Meaningless pretty things */
background: linear-gradient(45deg, powderBlue, ghostwhite);
@benjamincharity
benjamincharity / vim-delete-whitespace
Created Nov 13, 2012
Delete all trailing whitespace in Vim.
You can’t perform that action at this time.