Skip to content

Instantly share code, notes, and snippets.

View benjamincharity's full-sized avatar
🤖

Benjamin Charity benjamincharity

🤖
View GitHub Profile
@benjamincharity
benjamincharity / HTML5 in older IE
Created March 14, 2012 15:36
This snippet enables HTML5 elements in older versions of 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])}})()
@benjamincharity
benjamincharity / .gitignore_global
Created April 2, 2012 17:22
My global gitignore file
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@benjamincharity
benjamincharity / Faster Touch Links
Created April 26, 2012 03:10
Use touchend to get faster links on touch devices
@benjamincharity
benjamincharity / smooscroll.js
Created May 9, 2012 17:56 — forked from cange/smooscroll.js
Simple smooth scrolling solution
// <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 20:16
Fix the github auth issue where it asks for permissions every push/pull.
// 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
@benjamincharity
benjamincharity / Alfred Spotify Applescript
Created August 29, 2012 00:20
This applescript adds keyboard controls for Spotify via Alfred. via( http://tumblr.mobocracy.net/post/8473375264/alfred-meet-spotify )
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 October 9, 2015 13:27
A simple shell script for Alfred that creates a new project and updates all dependancies with 'create exampleName'.
# 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 September 10, 2012 03:57
Restart a paused OSX process by killing it via the command line.
$ ps -ax | grep Photoshop
## change 12345 to the PID number returned with the first command.
$ kill -CONT 12345
@benjamincharity
benjamincharity / dabblet.css
Created November 7, 2012 21:17
CSS Border with Box-Shadow Example
/**
* 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 November 13, 2012 12:57
Delete all trailing whitespace in Vim.
:%s/\s\+$//