Skip to content

Instantly share code, notes, and snippets.

View tdreyno's full-sized avatar

Thomas Reynolds tdreyno

  • Portland, OR
  • 08:00 (UTC -08:00)
View GitHub Profile
@tdreyno
tdreyno / gist:2007766
Created March 9, 2012 17:58
Constant physics time
physicsBuffer: 0
physicsFPS: 0.016 # 60 fps
animate: (delta) ->
@physicsBuffer += delta
while @physicsBuffer > @physicsFPS
@tickPhysics(@physicsFPS)
@physicsBuffer -= @physicsFPS
tickPhysics: (delta) ->
helpers do
def do_something
# look at request.path
end
end
configure :development do
activate :directory_indexes
end
@tdreyno
tdreyno / sprite_sheet.css
Created March 8, 2012 17:44
60 fps CSS Animation
@keyframes animate-particle {
0% {
background-position: 0 0px; }
1.695% {
background-position: 0 -124px; }
3.39% {
background-position: 0 -248px; }
var prop = "transform",
vendorProp, supportedProp, supports3d, supports2d, supportsFilter,
// capitalize first character of the prop to test vendor prefix
capProp = prop.charAt(0).toUpperCase() + prop.slice(1),
prefixes = [ "Moz", "Webkit", "O", "MS" ],
div = document.createElement( "div" );
source :rubygems
gem "middleman"
gem "middleman-i18n"
@tdreyno
tdreyno / gist:1866037
Created February 19, 2012 21:50
Webkit PNG Sequence Sprite Animation in Sass
@-webkit-keyframes animate-play {
@for $i from 0 through 116 {
$s: ($i * 100) / 116 + "%";
#{$s} { background-position: 0 ($i * -70px); }
}
}
=color-mixer($color-name, $color-hex)
$color-name: $color-hex
$color-name + Light: lighten($color-name, 8%)
$color-name + Lighter: lighten($color-name, 16%)
$color-name + Dark: darken($color-name, 8%)
$color-name + Dark: darken($color-name, 16%)
$purple
+color-mixer($purple, #a2385d)
---
es:
hello: "Hola"
paths:
"hello/mister": "hola/senor"
#= require './includes/helpers';
body {
margin: 0;
&> header {
.dimensions(100%, auto);
}
}