Skip to content

Instantly share code, notes, and snippets.

View steckel's full-sized avatar

Curtis Steckel steckel

  • San Francisco, CA
View GitHub Profile
var assert = require('assert');
var a = {
get a() {
return "a";
}
};
assert.deepEqual(Object.keys(a), ['a'], 'es6 enhanced object literals');
var b = {};
@steckel
steckel / .zshrc
Last active August 29, 2015 14:15
autoload -Uz promptinit
promptinit
prompt redhat
PROMPT="hello"
RPROMPT="world"
@steckel
steckel / slice.js
Last active August 29, 2015 14:16
Adobe Illustator -> PDF -> XCode 6+ workflow
/**
* Poor man's Slicy for Adobe Illustator -> PDF -> XCode 6+ workflow
*
* This niave script scans the current document for any GroupItem or
* CompoundPathItem who's name matches "@2x" in anyway. Once found, it
* will attempt to export them as PDF to `~/Desktop`.
*
* verboseMode {Bool=false} - When enabled, the script will alert information
* about each layer it attempts to scan.
*
@steckel
steckel / barchart.html
Last active August 29, 2015 14:17
Swift playgrounds inspired by http://bost.ocks.org/mike/bar/2/
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.chart rect {
fill: steelblue;
}
.chart text {
fill: white;
@steckel
steckel / simpleAssServer.coffee
Created September 30, 2011 19:53
Just a, stupid, simple executable coffeescript that'll serve up a folder on your filesystem
#!/usr/bin/env coffee
sys = require "sys"
http = require "http"
url = require "url"
path = require "path"
fs = require "fs"
argv = process.argv
@steckel
steckel / CoffeeScript.md
Created November 17, 2011 22:31
An introduction to CoffeeScript

CoffeeScript

A little language that compiles into JavaScript.

JavaScript is kind of a big deal.

The web was not built for the interactivity we have come to expect of it. Web pages were originally designed to contain static text and images. Hyperlinks were a way to travel between these static pages but, that was the extent of a page's interactivity.

Java and JavaScript emerged as competitors (Java is to JavaScript as Car is to Carpet) in web browsers promising to add a new level of dynamic content and interactivity.

@steckel
steckel / $.fn.getInlineStyleObject()
Created December 9, 2011 19:18
A helpful little JQuery plugin I adapted from http://jsfiddle.net/ZcEUL/
$.fn.getInlineStyleObject = function() {
var $element, prop, props, rprops, str, styleObject, _i, _len;
$element = this;
str = $element.attr("style");
rprops = /[\w-]+(?=:)/g;
props = str.match(rprops);
styleObject = {};
for (_i = 0, _len = props.length; _i < _len; _i++) {
prop = props[_i];
if ($element[0].style[prop] != null) {
@steckel
steckel / toCSSMatrix3d.coffee
Created December 16, 2011 00:40
Simple prototype function for String objects to take a CSS transformation string and return a CSSMatrix3d string.
String::toCSSMatrix3d = ->
webKitCSSMatrix = new WebKitCSSMatrix @
matrix3d = "matrix3d(#{webKitCSSMatrix.m11},#{webKitCSSMatrix.m12},#{webKitCSSMatrix.m13},#{webKitCSSMatrix.m14},#{webKitCSSMatrix.m21},#{webKitCSSMatrix.m22},#{webKitCSSMatrix.m23},#{webKitCSSMatrix.m24},#{webKitCSSMatrix.m31},#{webKitCSSMatrix.m32},#{webKitCSSMatrix.m33},#{webKitCSSMatrix.m34},#{webKitCSSMatrix.m41},#{webKitCSSMatrix.m42},#{webKitCSSMatrix.m43},#{webKitCSSMatrix.m44})"
matrix3d
console.log "scale3d(2, 2, 0) translate3d(-454px, 0px, 0px) rotate(1deg)".toCSSMatrix3d()
@steckel
steckel / gist:1617124
Created January 15, 2012 20:38
Objective-C meh

Why do we need to tell Objective-C what types of pointer variables something is when it's obvious after we alloc it?

NSFetchedResultsController *aFetchedResultsController = [NSFetchedResultsController alloc]

Shouldn't it be as simple as

aFetchedResultsController = NSFetchedResultsController alloc