Skip to content

Instantly share code, notes, and snippets.

View swannodette's full-sized avatar

David Nolen swannodette

View GitHub Profile
Fx.CSS.implement({
search: function(selector){
if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector];
var to = {};
function extract(sheet, j){
var href = sheet.href;
if (href && href.contains('://') && !href.contains(document.domain)) return;
var rules = sheet.rules || sheet.cssRules;
Array.each(sheet.imports, extract);
Fx.CSS.implement({
search: function(selector){
if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector];
var to = {};
function extract(sheet, j){
var href = sheet.href;
if (href && href.contains('://') && !href.contains(document.domain)) return;
var rules = sheet.rules || sheet.cssRules;
Array.each(sheet.imports, extract);
Function.implement({
decorate: function()
{
var decorators = $A(arguments);
var resultFn = this;
decorator = decorators.pop();
while(decorator)
{
resultFn = decorator(resultFn);
@swannodette
swannodette / snippet.txt
Created July 17, 2009 18:42 — forked from anonymous/snippet.txt
Bulk.json
[
{
"action": "read",
"table": "workset",
"properties": "*",
"constraints": {
"userid": "4511"
},
"orderby": [
">",
var verify1 = function(fn) {
return function() {
var args = $A(arguments);
if($type(args[0]) != "string")
{
throw new Error("First arg is not a string");
}
else
{
console.log("verify1 decorator run");
Browser.Request = function(){
return $try(function(){
return new GM.Request();
}, function(){
return new XMLHttpRequest();
}, function(){
return new ActiveXObject('MSXML2.XMLHTTP');
});
};
function() {
function $normalize(v) {
if($type(v) == "array")
{
v = v.normalize()
}
else if(['object', 'hash'].contains($type(v)))
{
v = $H(v).normalize();
this.allShifts = new SSResource("AllShifts", {
routes:{ create: {resource:'shift', id:"*"},
read: {resource:'shifts'},
update: {resource:'shift', id:"*"},
'delete': {resource:'shift', id:"*"}},
bindings: [{
match:[{resource:"shift", action:"favorite"},
{resource:"shift", action:"unfavorite"},
{resource:"shift", action:"publish"},
{resource:"shift", action:"unpublish"},
class Bar():
z = 3
class Foo():
x = 1
y = 2
def __init__(self):
self.other = Bar()
{
"data": {
"stream_name": "Categories",
"unique_name": "Categories",
"user_id": "4511",
"created_by_name": "dnolen",
"object_ref": "null",
"private": "0",
"meta": "category",
"id": "25",