Skip to content

Instantly share code, notes, and snippets.

View smt's full-sized avatar

Stephen Tudor smt

View GitHub Profile
@smt
smt / gist:12391
Created September 23, 2008 20:36
# Add this route to config/routes.rb
map.js ':controller/:action.:format'
/*
Form Elements
-- Styled to look like native Safari on OS X.
-- Drop-down <select> menus are unaffected.
-- Buttons are unaffected. Native OS style.
*/
input,
button,
select,
@smt
smt / grid.sass
Created March 25, 2011 23:19 — forked from jcroft/grid.sass
jcroft's grid setup
// REQUIRED VARS. Defaults to a 950px wide, 24-column grid that has 30px wide units and 10px wide
// gutters. If you do the fluid grid, then this 950/24/30/10px size will become the maximum size.
$grid_type: fixed !default
$grid_columns: 24 !default
$grid_column_width: 30 !default
$grid_gutter_width: 10 !default
// GENERATED VARS. You can ignore these.
$grid_full_width: $grid_columns * $grid_column_width + $grid_columns * $grid_gutter_width - $grid_gutter_width
$grid_column_width_percent: ($grid_column_width / $grid_full_width * 100) * 1%
(function() {
var eventMatchers = {
'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
'MouseEvents': /^(?:click|mouse(?:down|up|over|move|out))$/
};
var defaultOptions = {
pointerX: 0,
pointerY: 0,
button: 0,
ctrlKey: false,
@smt
smt / adapt.js
Created April 13, 2011 11:37 — forked from nathansmith/adapt.js
// Edit to suit your needs.
var ADAPT_CONFIG = {
// Where is your CSS?
path: 'assets/css/',
// false = Only run one time, when page first loads.
// true = Change for window resize or page tilt too.
dynamic: true,
// First range entry is the minimum.

A pure CSS bendy shadow:

I suspect that some trig calculations could make this very general.

bendy_shadow

@smt
smt / html.snippets
Created July 29, 2011 01:29
HTML snippets for vim-snipmate
# Some useful Unicode entities
# Non-Breaking Space
snippet nbs
&nbsp;
# ←
snippet left
&#x2190;
# →
snippet right
&#x2192;
@smt
smt / vim7.3_mac_install.rb
Created March 31, 2012 15:06 — forked from sirupsen/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@smt
smt / index.html
Created September 5, 2012 20:45
CSS Toggle Switch - Just add the class 'active' to make the switch transition to ON state, remove to return to OFF state.
<a href="#" class="toggle"><b class="handle"></b></a>
@smt
smt / index.html
Created September 6, 2012 17:03
CSS Toggle Switch (no js) - Just add the class 'active' to make the switch transition to ON state, remove to return to OFF state. Similar to http://codepen.io/smt/pen/oywvG, but uses a checkbox input rather than a link, which removes the JS requirement. T
<form>
<div class="toggle">
<input type="checkbox" name="toggleSwitch" id="toggleSwitch" />
<label for="toggleSwitch">&zwj;</label>
</div>
</form>