Skip to content

Instantly share code, notes, and snippets.

View dethe's full-sized avatar

Dethe Elza dethe

View GitHub Profile
class Foo
constructor: (args...) ->
# do something with args
class Bar extends Foo
constructor: (args...) ->
super(args...)
new Bar(1,2,3)
require 'rubygems'
require 'cairo'
require 'rmagick'
img = Magick::Image::read('test.jpg').first
puts 'Getting bounding box'
width = img.columns
height = img.rows
puts 'Finding stride for width ' + width.to_s
@dethe
dethe / gist:721274
Created November 30, 2010 07:01
response from couchdb on attachment upload
Request URL:http://localhost:5984/kinzin/layout_sign_in
Request Method:POST
Status Code:201 Created
Request Headers
Accept:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Length:550139
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryTMHEvBA4sZ200O6E
Origin:http://localhost:5984
Referer:http://localhost:5984/kinzin/_design/obloq/_show/block/layout_sign_in
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-ca) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
/**
* Additional content section / block functions for body.
*/
var rootpath = process.cwd() + '/',
path = require('path'),
calipso = require(path.join(rootpath, 'lib/calipso'));
exports = module.exports = function(req, options, callback) {
@dethe
dethe / dabblet.css
Created February 19, 2012 06:42
Dabble dabble toil and travail
/**
* Dabble dabble toil and travail
*/
background: #f06;
background: linear-gradient(47deg, #f06, yellow, #049, #000, #F0F);
min-height:100%;
@dethe
dethe / settings.json
Created February 21, 2012 06:10
Huzzah!
{}
@dethe
dethe / waterbear.json
Created February 23, 2012 05:59
Huzzah 2
scriptfunction _start(){[[1]]}_start();labelwhen program runsklasscontrollocalssocketstriggertruenextcontainers1containedscriptwindow.alert({{1}});labelalert [string]klassstringslocalssocketsHuzzah!nextcontainers0contained
@dethe
dethe / waterbear.json
Created February 23, 2012 06:07
Huzzah 2
{"scripts":[{"klass":"control","label":"when program runs","script":"function _start(){[[1]]}_start();","containers":1,"trigger":true,"locals":[],"sockets":[],"contained":[{"klass":"strings","label":"alert [string]","script":"window.alert({{1}});","containers":0,"locals":[],"sockets":["Huzzah!"],"contained":[],"next":""}],"next":""}],"title":"Huzzah 2","version":"0.4","plugin":"canvas","type":"application/json","format":"waterbear script"}
@dethe
dethe / blacklightworms.pjs
Created September 11, 2012 19:56
Example code to test processing.js embeddeding in Tumblr
int number = 15;
float[] x = new float[number];
float[] y = new float[number];
float[] r = new float[number];
float[] theta = new float[number];
float[] offset = new float[number];
int minRadius = 30;
int maxRadius = 60;
void setup(){
@dethe
dethe / random_circles.js
Last active October 13, 2015 04:57
Simplest example of a Waterbear script (for Javascript canvas)
local.count_1 = 0;
(function() {
setInterval(function() {
local.count_1++;
var point_2 = {
x: randint(0, global.stage_width),
y: randint(0, global.stage_height)
};
var radius_2 = randint(20, 50);
var color_2 = "rgb(" + randint(0, 255) + "," + randint(0, 255) + "," + randint(0, 255) + ")";