Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
export GIT_EDITOR="subl -w"
if [[ -x `which git` ]]; then
# Hub
if [[ -x `which hub` ]]; then
# alias git=hub
@marcedwards
marcedwards / high-dpi-media.css
Last active September 24, 2025 23:32
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@necolas
necolas / _mixin-better.scss
Created April 13, 2012 15:52
Sass grid construction
// Still need to work out how to combine rules for numbers
// that share a greatest common factor without the unit-builder
// actually containing the fraction to which they can both be
// reduced.
// Calculate the greatest common factor of two integers
@function gcf($a, $b) {
@if $b == 0 {
@return $a;
}
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@k2052
k2052 / scriptingCSH.rb
Created February 14, 2012 07:18
make sure to install rbappscript first. Then you'll need the MakeCustomShape action installed from here http://cl.ly/2x3Z2j3a2B0X292b1f1S. Theoretically that is it. Works for me, hopefully for you as well.
require 'rubygems'
require 'appscript'
# Make sure to open your apps first. Appscript can get ahead of itself and not wait for them to load so it will fail
# Set your dir with AI files and thats it
dirname = "/Users/kenerickson/testCSH"
ai = Appscript.app.by_id('com.adobe.illustrator')
ps = Appscript.app.by_id('com.adobe.photoshop')
# ps = Appscript.app("/Applications/Adobe Photoshop CS3/Adobe Photoshop CS3.app")
@scottjehl
scottjehl / fixorientationzoom.js
Created January 6, 2012 00:27
Fix iOS Orientation Change Zoom Bug
/*
NOTE!!!!
The most updated version of this code is here:
https://github.com/scottjehl/iOS-Orientationchange-Fix
@LeaVerou
LeaVerou / vunits.js
Created November 8, 2011 11:05
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@nathansmith
nathansmith / .htaccess
Created October 1, 2011 03:33
Route extension-less files to HTML.
# Route extension-less URLs to the equivalent *.html file.
# For instance: example.com/about = example.com/about.html
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
</IfModule>
@funkatron
funkatron / gimmebar_jsonp.html
Created September 26, 2011 15:01
Getting data from Gimme Bar API via JSONP
<!-- pass jsonp_callback=foo, where "foo" is the function name -->
<!-- For all public assets from a given user: -->
<script src="https://gimmebar.com/api/v0/public/assets/funkatron.js?jsonp_callback=foo">
<!-- For all public assets from a given user's collection: -->
<script src="https://gimmebar.com/api/v0/public/assets/funkatron/sports.js?jsonp_callback=foo">
<!-- See https://gimmebar.com/api/v0#Public for more information on the public (no auth required) methods -->
@scottjehl
scottjehl / hideaddrbar.js
Created August 31, 2011 11:42
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){