Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/macruby
s = "#{
"\uFEFF".encode("UTF-8").force_encoding("BINARY")
}"
puts "A single BOM Worked!"
s = "first: #{
"\uFEFF".encode("UTF-8").force_encoding("BINARY")
} second: #{
@timmfin
timmfin / handlebars inverted section contex tester.html
Created October 21, 2010 20:08
The context (both this and the passedContext) are set incorrectly for inverted sections. See the console output when you visit this page (requires firebug, webkit inspector, or something else that provides console.log).
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<script type="text/javascript" charset="utf-8" src="http://github.com/wycats/handlebars.js/raw/master/lib/handlebars.js"></script>
<script type="text/javascript" charset="utf-8">
var template = "Testing the context of inverted sections. {{#checkMe}} Yes {{/checkMe}} {{^checkMe}} No {{/checkMe}}";
@timmfin
timmfin / gist:727134
Created December 3, 2010 15:58
Suggested changes to jsclass callSuper() doc

Now we come to a special method generated by JS.Class, called callSuper(). This method gets created dynamically inside method calls and allows you to access the current method in the parent class. Similar to Ruby, you don’t have to pass any arguments to callSuper(), thus avoiding repetition. The arguments given to the current method are automatically passed by callSuper() up to the parent method.

var rex = new Dog('Rex');
rex.speak('barking')
// -> "MY NAME IS REX AND I LIKE BARKING!"

...

You can pass arguments to callSuper() to override the ones passed in automatically, e.g.:

#!/bin/sh
compass watch -r src/sass-extensions/colors.rb &
COMPASS_PID=$!
jitter src/static/coffee src/static/j/compiled &
JITTER_PID=$!
echo "Compass and coffee pids: " $COMPASS_PID $JITTER_PID
echo "Press ctrl-c to kill both (testing)"
@timmfin
timmfin / flickr-images.styl
Created March 16, 2013 16:20
Stylus code to implement an evenly spaced horizontal list of images (that shows more images as the browser width gets wider).
@import 'base-styles'
@import 'base-units'
// For mobile-ish sizes, show the images in a single line
// horizontally with even spacing inbetween while still
// keeping the first and last images flush.
section.flickr
@extend .left-and-right-gutters
@timmfin
timmfin / ie-selector-limit-test.css
Last active December 16, 2015 07:08
A test of IE 6-9's CSS stylesheet limitations (more info http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx). Download the gist and view it in IE 6-9 to see for yourself!
.redClass0001 { background: red }
.redClass0002 { background: red }
.redClass0003 { background: red }
.redClass0004 { background: red }
.redClass0005 { background: red }
.redClass0006 { background: red }
.redClass0007 { background: red }
.redClass0008 { background: red }
.redClass0009 { background: red }
.redClass0010 { background: red }
@timmfin
timmfin / gist:8d0e205acdc093c05318
Created October 2, 2014 20:15
Output from local bender/broccoli build (with symlink and file content hash changes in affect)
tfinley at Valinor in ~/src/bender-broccoli on master!
± coffee cli.coffee
Loading Brocfile for AnotherStaticUI
Loading Brocfile for ExampleStaticBase
Loading Brocfile for ParagonUI
Loading Brocfile for style_guide
Loading Brocfile for StyleGuideUI
Loading Brocfile for common_assets
Serving on http:#localhost:3333
@timmfin
timmfin / index.html
Last active August 29, 2015 14:23
CSSOM blocking test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- Borrowed from https://www.igvita.com/2014/05/20/script-injected-async-scripts-considered-harmful/ -->
<meta name="robots" content="noindex">
<title>CSSOM blocking test</title>
</head>
<body>
@timmfin
timmfin / Readme.md
Last active September 3, 2015 16:19
llr

Note, very likely specific to OSX as it is right now.

Example:

tfinley at BOSMM2N693QG3QD in /tmp/find-test
$ llr .
a