Skip to content

Instantly share code, notes, and snippets.

@davefearon
davefearon / style.sass
Created November 4, 2011 04:50 — forked from destroytoday/style.sass
Prevents iOS from changing the font size of paragraphs in landscape
@media only screen and (min-device-width: 320px) and (max-device-width: 1024px)
html
-webkit-text-size-adjust: none
@davefearon
davefearon / h5bp-twitter-bootstrap
Created December 5, 2011 21:49 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@davefearon
davefearon / _config.yml
Created December 7, 2011 04:25
Jekyll + Liquid + pagination = win!
paginate: 5
@davefearon
davefearon / h5bp-twitter-bootstrap
Created December 16, 2011 18:58 — forked from paulirish/h5bp-twitter-bootstrap
h5bp + twitter bootstrap integration
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@davefearon
davefearon / pre-receive
Created December 21, 2011 22:03
A pre-receive hook for rejecting things not tagged
#!/bin/sh
validate_ref()
{
# --- Arguments
oldrev=$(git rev-parse $1)
newrev=$(git rev-parse $2)
refname="$3"
# oldrev could be 0s which means creating refname
@davefearon
davefearon / Deploy.tmCommand
Created December 22, 2011 04:04 — forked from henrik/Deploy.tmCommand
TextMate command to deploy a Jekyll site through a tasks/deploy shell script.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>C9BD1ADE-4FD9-4842-A641-DFB373B7D42C</string>
<key>command</key>
<string>#!/usr/bin/env ruby
@davefearon
davefearon / fixorientationzoom.js
Created January 6, 2012 00:45 — forked from scottjehl/fixorientationzoom.js
Fix iOS Orientation Change Zoom Bug
/*
An attempt at fixing the dreaded iOS orientationchange zoom bug http://adactio.com/journal/5088/. Seems to work!
Authored by @scottjehl
MIT License.
*/
(function(w){
var doc = w.document;
if( !doc.querySelectorAll ){ return; }
@davefearon
davefearon / gist:1665253
Created January 23, 2012 20:02 — forked from adamjspooner/gist:1665152
Duck punching JavaScript's Number for toString() typos.
Number.prototype.yoString = function() {
return 'Yo, ' + this + '!';
};
var num = 3;
console.log(num.yoString());
@davefearon
davefearon / README.markdown
Created March 19, 2012 15:16 — forked from lukemorton/README.markdown
Set caret position via jQuery

jQuery Caret

This is a very simple lightweight plugin to allow you to move the caret (or cursor) position in an <input /> or <textarea> element.

By exposing three jQuery.fn methods you can easily move a a caret to any position you like:

$.fn.caretTo( index , [ offset ] )

@davefearon
davefearon / gist:5147768
Last active December 14, 2015 20:59 — forked from markmarkoh/gist:2969317
All countries path data in JSON format
var countries_data = {"type":"FeatureCollection","features":[
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[74.92,37.24],[74.57,37.03],[72.56,36.82],[71.24,36.13],[71.65,35.42],[71.08,34.06],[69.91,34.04],[70.33,33.33],[69.51,33.03],[69.33,31.94],[66.72,31.21],[66.26,29.85],[62.48,29.41],[60.87,29.86],[61.85,31.02],[60.84,31.5],[60.58,33.07],[60.94,33.52],[60.51,34.14],[61.28,35.61],[62.72,35.25],[63.12,35.86],[64.5,36.28],[64.8,37.12],[66.54,37.37],[67.78,37.19],[69.32,37.12],[70.97,38.47],[71.59,37.9],[71.68,36.68],[73.31,37.46],[74.92,37.24]]]]},"properties":{"name":"Afghanistan"},"id":"AF"},
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[19.44,41.02],[19.37,41.85],[19.65,42.62],[20.07,42.56],[20.59,41.88],[20.82,40.91],[20.98,40.86],[20.01,39.69],[19.29,40.42],[19.44,41.02]]]]},"properties":{"name":"Albania"},"id":"AL"},
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[2.96,36.8],[8.62,36.94],[8.18,36.52],[8.25,34.64],[7.49,33.89],[9.06,3