Skip to content

Instantly share code, notes, and snippets.

@jscheel
jscheel / fiddle.response.json
Created January 31, 2012 16:16 — forked from traviskroberts/gist:1711232
fiddle.response.json
[
{
"id": 1,
"account_id": 3,
"wine_id": 646,
"qty": 12,
"format": "bottle",
"vintage": 1982,
"created_at": "2012-01-30T16:26:22Z",
"updated_at": "2012-01-30T16:26:22Z",
{
[
{type: 'merlot'},
{type: 'zinf'}
]
}
@jscheel
jscheel / CoffeeScriptPreview.py
Created December 16, 2011 06:56
coffee2js sublime text 2 plugin
# not perfect yet (env. not set properly, and still not 100% about the escaping)
import sublime, sublime_plugin
from subprocess import Popen, PIPE, STDOUT
import sublime, sublime_plugin
from subprocess import Popen, PIPE, STDOUT
class CoffeescriptToJsCommand(sublime_plugin.TextCommand):
@jscheel
jscheel / colorlist.php
Created August 4, 2011 05:28
List all colors in css file
<?php
//needs to be expanded to include #fff and also needs to be more robust, but it's a start
$colorsString = shell_exec("grep -o -h '#......;' ./style.css | tr [A-Z] [a-z] | sort | uniq");
$colors = array_filter(explode("\n", str_replace(array('#', ';'), '', $colorsString)));
header("Content-Type: image/png");
$im = @imagecreate(210, 20 * count($colors))
var fs = require('fs'), libxml = require('./libxmljs');
var parser = new libxml.SaxPushParser(function(cb) {
var stack = [];
cb.onStartDocument(function() {
console.log('Starting to parse ...');
});
cb.onStartElementNS(function(elem, attrs, prefix, uri, namespaces) {
var obj = {};
obj['@'] = {};
DROP TEMPORARY TABLE IF EXISTS contact_report;
DROP TEMPORARY TABLE IF EXISTS contact_report_address;
DROP TEMPORARY TABLE IF EXISTS contact_report_group;
CREATE TEMPORARY TABLE contact_report_group SELECT gc.contact_id, GROUP_CONCAT(DISTINCT g.name ORDER BY g.name ASC SEPARATOR ", ") as groups FROM civicrm_group_contact gc LEFT JOIN civicrm_group g ON gc.group_id=g.id GROUP BY gc.contact_id;
CREATE TEMPORARY TABLE contact_report_address SELECT a.contact_id, a.street_address, a.city, a.postal_code, sp.abbreviation as state FROM civicrm_address a LEFT JOIN civicrm_state_province sp ON a.state_province_id=sp.id GROUP BY a.contact_id;
CREATE UNIQUE INDEX idx ON contact_report_address (contact_id);
package com.jaredscheel.utils
{
import flash.utils.Dictionary;
import flash.system.ApplicationDomain;
public class ClassManager
{
public static const instance:ClassManager = new ClassManager();
private var _classes:Dictionary = new Dictionary();