This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Using Jinja2 with Django 1.2 | |
Based on: http://djangosnippets.org/snippets/2063/ | |
To use: | |
* Add this template loader to settings: `TEMPLATE_LOADERS` | |
* Add template dirs to settings: `JINJA2_TEMPLATE_DIRS` | |
If in template debug mode - we fire the template rendered signal, which allows | |
debugging the context with the debug toolbar. Viewing source currently doesnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hypermedia.video.*; | |
OpenCV opencv; | |
void setup() { | |
size( 640, 480 ); | |
// open video stream | |
opencv = new OpenCV( this ); | |
opencv.capture( 640, 480 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
size(800,600); | |
background(255); | |
noStroke(); | |
colorMode(RGB); | |
frameRate(15); | |
} | |
void draw() { | |
color c = color(random(255),random(255),random(255)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hypermedia.video.*; // Imports the OpenCV library | |
OpenCV opencv; // Creates a new OpenCV object | |
PImage movementImg; // Creates a new PImage to hold the movement image | |
int poppedBubbles; // Creates a variable to hold the total number of popped bubbles | |
ArrayList bubbles; // Creates an ArrayList to hold the Bubble objects | |
PImage bubblePNG; // Creates a PImage that will hold the image of the bubble | |
PFont font; // Creates a new font object | |
void setup() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @namespace http://douban.com | |
// @include http://www.douban.com/* | |
// @author Qing Feng | |
// @description Douban Next Link | |
// @version 20110307 | |
// ==/UserScript== | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hypermedia.video.*; | |
OpenCV opencv; | |
void setup() { | |
size(480, 320); | |
opencv = new OpenCV(this); | |
opencv.capture(width/2, height/2); | |
} | |
void draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hypermedia.video.*; | |
import java.awt.Rectangle; | |
OpenCV opencv; | |
void setup() { | |
size( 320, 240 ); | |
opencv = new OpenCV(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export R=$1 | |
export G=$2 | |
export B=$3 | |
/usr/bin/osascript <<EOF | |
tell application "Terminal" | |
tell window 0 | |
set the background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Love | |
// @namespace http://091018.com | |
// @include http://www.douban.com/people/* | |
// @description Love | |
// @version 20101015 | |
// ==/UserScript== | |
/*globals XPathResult, GM_getValue, GM_setValue, localStorage, unescape, | |
frameElement */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Demo | |
// @namespace http://youdomain.com | |
// @include http://www.douban.com/* | |
// @description Demo | |
// @version 20101015 | |
// ==/UserScript== | |
/*globals XPathResult, GM_getValue, GM_setValue, localStorage, unescape, | |
frameElement */ |