Skip to content

Instantly share code, notes, and snippets.

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();
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);
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['@'] = {};
@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))
@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):
{
[
{type: 'merlot'},
{type: 'zinf'}
]
}
@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",
@jscheel
jscheel / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jscheel
jscheel / groove-turbolinks-embed.html
Last active May 21, 2022 00:08
Turbolinks-compatible version of the Groove support widget
@jscheel
jscheel / groove-widget-command-queue-example.html
Last active September 12, 2016 07:04
Demonstrates how to push additional commands to the widget command queue.
<button id="load">Load Widget</button>
<button id="open">Open Widget</button>
<!-- BEGIN GROOVE WIDGET CODE -->
<script id="grv-widget">
/*<![CDATA[*/
window.groove = window.groove || {}; groove.widget = function(){ groove._widgetQueue.push(Array.prototype.slice.call(arguments)); }; groove._widgetQueue = [];
groove.widget('setWidgetId', 'INSERT YOUR WIDGET ID HERE');
groove.widget('setAutoload', false);
!function(g,r,v){var a,c,n=r.createElement("iframe");(n.frameElement||n).style.cssText="width: 0; height: 0; border: 0",n.title="",n.role="presentation",n.src="javascript:false",r.body.appendChild(n);try{a=n.contentWindow.document}catch(b){c=r.domain;var d="javascript:document.write('<head><script>document.domain=\""+c+"\";</",i="script></head><body></body>')";n.src=d+i,a=n.contentWindow.document}var s="https:"==r.location.protocol?"https://":"http://",p="http://groove-widget-production.s3.amazonaws.com".replace("http://",s);n.className="grv-widget-tag",a.open()._l=function(){c&&(this.domain=c);var