Skip to content

Instantly share code, notes, and snippets.

require 'ruby-processing'
class Radiohead < Processing::App
load_libraries :opengl, :video
include_package "processing.opengl"
include_package "processing.video"
def setup
render_mode OPENGL
require 'rubygems'
require 'pp'
# -------
cond1 = {
:type => 'transaction_field',
:params => {
:field => 'store_id',
:operator => 'equals',
:value => 9
/////////////////////////////////////
// In the promotion rule application:
rule = new Rule();
rule.callbacks.get_condition_options = function(type, property, operator, value) {
// Make AJAX call to services:
// GET /promos/rules/options?type=type&property=property&operator=operator&value=value
// Parse the server response into whatever return format is expected of this type of
// callback function (as defined by the general purpose rule system)
json = getJsonFromServer();
rule = Rule.from_json(json)
rule.condition_set
html = getHtmlRepresentation();
rule = Rule.from_html(html)
rule.condition_set
# rake/cap task completion
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
_rakecomplete() {
COMPREPLY=($(compgen -W "`rake -s -T 2>/dev/null | awk '{{print $2}}'`" -- ${COMP_WORDS[COMP_CWORD]}))
return 0
}
complete -o default -o nospace -F _rakecomplete rake
12345 MY REALLY REALLY REALLY 123.99
REALLY REALLY LONG DESC
RIPTION
function buffered_write(func) {
var old_write = document.write;
var buffer = '';
document.write = function(string) {
buffer += string;
};
func();
document.write = old_write;
return buffer;
}
function buffered_write(func) {
var old_write = document.write;
var buffer = '';
document.write = function(string) {
buffer += string;
};
func();
document.write = old_write;
return buffer;
}
// ==UserScript==
// @name Lemmingtrail Image Inliner
// @namespace http://jasonstotz.com/
// @version 0.0.1
// @include http://*.lemmingtrail.com/*
// @include http://lemmingtrail.com/*
// ==/UserScript==
(function () {
var regex = /<a href="([^"]*)" class="tr1">IMAGE\s*REMOVED\s*-\s*CLICK\s*TO\s*VIEW<\/a>/g;
inthepink@inthepink1:~$ gem list
*** LOCAL GEMS ***
actionmailer (1.3.5)
Service layer for easy email delivery and testing.
actionpack (1.13.5)
Web-flow and rendering framework putting the VC in MVC.