Skip to content

Instantly share code, notes, and snippets.

View milcktoast's full-sized avatar
🔬
Making Microbium

Ash Weeks milcktoast

🔬
Making Microbium
View GitHub Profile
@milcktoast
milcktoast / file.plist
Created March 23, 2012 05:22 — forked from schinckel/file.plist
Jekyll Syntax Grammar for TextMate
{ scopeName = 'text.html.jekyll';
foldingStartMarker = '(?x)
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|<!--(?!.*-->)
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
)';
foldingStopMarker = '(?x)
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|^\s*-->
|(^|\s)\}
set : function (key, val, trigger) {
var i;
if (typeof key === "string") {
if (this.__data[key] !== val) {
if (this['set_' + key]) {
val = this['set_' + key](val);
}
@milcktoast
milcktoast / easings.scss
Created February 12, 2013 22:09
Easing functions for Sass/Compass
// Description:
// Easing functions
//
// Requires:
// - Sass
// - Compass
// Quadratic
@function ease-quadratic-in($k) {
@return $k * $k;
@milcktoast
milcktoast / index.html
Created March 22, 2013 16:39
Car along a quadratic curve.
<div id="canvas"></div>
<div id="info">
<div id="angle"></div>
</div>
<script type="text/javascript" src="https://raw.github.com/toji/gl-matrix/master/dist/gl-matrix.js"></script>
<script type="text/javascript" src="https://raw.github.com/dannygarcia/fil/master/fil.min.js"></script>
<snippet>
<content><![CDATA[for (var ${20:i} = 0, ${30:il} = ${1:Things}.length; ${20:i} < ${30:il}; ${20:i} ++) {
${100:${1:Things}[${20:i}]}$0
}]]></content>
<tabTrigger>for</tabTrigger>
<scope>source.js</scope>
<description>for (…) {…}</description>
</snippet>
@milcktoast
milcktoast / position.scss
Created September 27, 2013 18:46
Position mixin
@mixin position ($pos: relative, $coords: 0 0 0 0) {
@if type-of($pos) == list {
$coords: $pos;
$pos: relative;
}
$length: length($coords);
position: $pos;
@if $length > 0 { top: nth($coords, 1); }
<snippet>
<content><![CDATA[setTimeout(${2:function () \{ $3 \}}, ${1:0});]]></content>
<tabTrigger>timeout</tabTrigger>
<scope>source.js</scope>
<description>setTimeout function</description>
</snippet>
{
"scope": "source.scss",
"completions":
[
{ "trigger": "include\t@include", "contents": "@include ${1:mixin}(${2:});" },
{ "trigger": "extend\t@extend", "contents": "@extend ${1:.something};" }
]
}

This example demonstrates accelerated two-dimensional filtering enabled by d3.geom.quadtree. A quadtree recursively subdivides square cells into four equal-sized subcells. Each leaf node of the quadtree contains a single point. If a given quadtree cell does not intersect the brush extent, then none of the points contained in that subtree can be selected, and thus do not need to be scanned. Above, orange indicates points that are scanned but not selected. Without a quadtree, all points would need to be scanned!

@milcktoast
milcktoast / HTML.tmLanguage
Created November 3, 2013 23:31
Adds GLSL syntax highlighting to inline `<script type="shader">` tags.
<!-- Begin glsl -->
<dict>
<key>begin</key>
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)(?=.*type=["']shader(.*)?['"])</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.tag.begin.html</string>