Skip to content

Instantly share code, notes, and snippets.

// Original broccoli-stew afterBuild implementation does this:
// (https://github.com/stefanpenner/broccoli-stew/blob/01ec03f98b9b3f076697f9653d75487ae08426ab/lib/after-build.js#L23-L35)
return {
read: function(readTree) {
return readTree(tree).then(function(dir) {
cb(dir);
return dir;
}).catch(function(err) {
console.log(err);
@timmfin
timmfin / broccoli-quick-plugin.js
Created November 23, 2015 22:41
My thought process trying to figure out how to implement quick, anonymous "wrapper plugin" in broccoli v1.0.0-beta.5.
// Prototype of an "anonymous" plugin helper, since you can no longer have have filters/plugins that are object literals
// (like `return { build: function() { ... } }` ). And because the builder will error on any node without `__broccoliGetInfo__`
//
// To be used like so:
//
// return QuickPlugin(inputNodes, {
// build: function() {
// /* you're code here */
// }
// });
@timmfin
timmfin / linecat.sh
Created September 4, 2015 05:10
linecat
#!/bin/bash
MAGENTA=$(echo -en '\033[00;35m')
BLUE=$(echo -en '\033[00;34m')
RESTORE=$(echo -en '\033[0m')
FILE=`echo $1 | awk -F: '{print $1}'`
LINE=`echo $1 | awk -F: '{print $2}'`
LINE_PLUS_ONE=$(($LINE + 1))
LINE_MINUS_ONE=$(($LINE - 1))
@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
@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 / 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 / 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 / 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
#!/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 / 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.: