Skip to content

Instantly share code, notes, and snippets.

View d33pfri3d's full-sized avatar
🏠
Working from home

Shaun D d33pfri3d

🏠
Working from home
View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
layout title description categories
post
Quick Tip: Check mobile accessibility
Remember to check accessibility on mobile web pages.
Quick Tips
# My ~/.gitconfig file
# (with personal information removed)
# Take what you will!
[user]
name = YOUR NAME
email = YOUR EMAIL
[github]
user = YOUR USERNAME
token = YOUR TOKEN
[core]
//Conditionally load jQuery
//inspired by http://www.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/
window.onload = function () {
if (typeof jQuery == 'undefined') {
var jQ = document.createElement('script');
jQ.type = 'text/javascript';
jQ.onload = jQ.onreadystatechange = myOnLoadEvent;
jQ.src = ( "https:" == location.protocol ? "https//" : "http//" ) + 'ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
document.body.appendChild(jQ);
@d33pfri3d
d33pfri3d / phonegapCamera.js
Created March 8, 2012 22:17 — forked from matsumotius/phonegapCamera.js
Phonegap : Camera
function getPicture(){
navigator.camera.getPicture(function(data){
// success handler
alert('success');
}, function(){
// error handler
alert('error');
}, {
// options
quality: 50
@d33pfri3d
d33pfri3d / gist:2003803
Created March 8, 2012 22:15 — forked from paulirish/gist:366184
HTML5 : Geolocation with Fallback
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;
@d33pfri3d
d33pfri3d / jquery.ba-tinypubsub.js
Created March 8, 2012 22:09 — forked from cowboy/HEY-YOU.md
jQuery : Tiny Pub Sub
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);