Skip to content

Instantly share code, notes, and snippets.

View Softwave's full-sized avatar

Softwave Softwave

View GitHub Profile
@Softwave
Softwave / Screen.js
Created November 15, 2014 04:22
Make a time lapse on OS X
var count = 0;
var command;
var interval;
var directory = "~/Desktop/";
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
function takeScreen() {
var r, g, b;
function setup() {
createCanvas(windowWidth, windowHeight);
//drums = EDrums('x*o*x*o-');
//follow = Follow(drums);
drums = EDrums( 'x*o*x*o-' )
var old_time = new Date();
for (var i = 0; i <= 1000000000; i++) {
//console.log(i);
}
var new_time = new Date();
var time_passed = new_time - old_time;
//console.log(time_passed);
data Color = Red | Black | Rgb Int Int Int
toString : Color -> String
toSring color =
case color of
Red -> "Red"
Black -> "Black"
Rgb r g b -> "Other"
Scripting:
(1) Here is an example script (all one file):
#(init) input, sprite -- An "init" event (runs once) that initializes the "input" and "sprite" packages
Sprite.AddTrail(-1); -- This function is called from the sprite package (without sprite, it will crash)
#(init) controller -- Another "init" event that initializers the "controller" package (so that it can be used in update)
#(update) input, controller -- An "update" event that uses the "input" and "controller" packages
if (Input.Left())
Controller.Move(-100.0);
@Softwave
Softwave / csvTest.lua
Created June 23, 2014 17:58
csvTest.lua
groups = DAME.GetGroups()
groupCount = as3.tolua(groups.length) -1
FileExt = as3.tolua(VALUE_FileExt)
csvDir = as3.tolua(VALUE_CSVDir)
-- Output tilemap data
function exportMapCSV( mapLayer, layerFileName, groupName )
-- get the raw mapdata. To change format, modify the strings passed in (rowPrefix,rowSuffix,columnPrefix,columnSeparator,columnSuffix)
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
@Softwave
Softwave / test2.pde
Created February 13, 2014 01:09
test 2
size(1000,1000);
background(255);
strokeWeight(3);
stroke(20,21,24);
bezier(189,179,175,165,149,171,137,185);
bezier(137,185,102,230,153,266,196,248);
strokeWeight(1);
stroke(20,21,24);
bezier(180,173,183,174,185,179,189,179);
//first
strokeWeight(1);
stroke(35,31,32);
bezier(377,-692,380,-691,382,-687,386,-687);
bezier(386,-687,372,-701,346,-695,334,-681);
bezier(334,-681,299,-636,350,-600,393,-618);
//second
fill(35,31,32);
bezier(420,-690,423,-687,420,-683,423,-679);
@Softwave
Softwave / gist:7417801
Created November 11, 2013 18:22
Typer
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
/*
* RetroTerm
*/
static void prnt(char ch);