Skip to content

Instantly share code, notes, and snippets.

View jnslxndr's full-sized avatar

jens alexander jnslxndr

  • Baltic Sea
View GitHub Profile
@jnslxndr
jnslxndr / Anystream300_tei2012.ino
Created February 21, 2012 23:07
Flexible Circuit Sequencer Anystream 3000
/*
Flexible Circuit Sequencer Anystream 3000
Martin Murer, Eckhard Riedenklau, Jens A. Ewald TEI 2012
*/
const int testPin = A0;
const int audioPin = 11;
const int startPin = 2;
const int endPin = startPin+8;
@jnslxndr
jnslxndr / battery.rb
Created April 3, 2012 20:58 — forked from alexmcpherson/battery.rb
Ruby Battery Level
#!/usr/bin/env ruby
# coding: utf-8
output = `pmset -g batt`
percent_battery = output.match(/\d+\%/).to_s.gsub("%","").to_f
empty = '▹'
filled = '▸'
color_green = '%{%}'
color_yellow = '%{%}'
@jnslxndr
jnslxndr / 8bitNumbersAsDefinedBytes.coffee
Created April 16, 2012 13:25
Generate Byte defines for C/C++ in coffee
# ===================================================
# = Generate Bytes for all 8bit Numbers for #define =
# ===================================================
if (typeof String.prototype.lpad != 'function')
String.prototype.lpad = (padString, length) ->
str = this
while str.length < length
str = padString + str
return str
@jorgenpt
jorgenpt / stream.sh
Created April 21, 2012 06:59
Commands to stream desktop to justin.tv on OS X
#!/bin/sh -xe
API_KEY="YOUR_API_KEY_GOES_HERE"
FPS="10"
VLC_PATH="/Applications/VLC.app/Contents/MacOS/VLC"
# I don't know how this'll behave on multimon, so you might want to hard-code.
# INRES='1440x900'
INRES=$(osascript -e 'tell application "Finder" to get bounds of window of desktop'|sed 's/, /x/g'|cut -f3- -dx)
OUTRES='1280x800'
# You can change this to record microphone or something else, from man soxformat (under coreaudio):
@andphe
andphe / gist:3232343
Created August 2, 2012 01:41
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@arian
arian / crop.js
Created August 5, 2012 19:33
Cropping images with nodejs streams and imagemagick
var spawn = require('child_process').spawn;
var Stream = require('stream');
/**
* crops and resizes images to our desired size
* @param {Stream} streamIn in stream containing the raw image
* @return {Stream}
*/
exports.cropImage = function(streamIn){
@artisonian
artisonian / .gitignore
Last active March 21, 2024 20:13
go-eventsource
eventsource
go-eventsource
client/client
@tomraithel
tomraithel / gist:4085483
Created November 16, 2012 08:31
RUBY: A Rakefile for creating a zip from files within a directory
require 'rake/packagetask'
namespace :my_namespace do
desc "Make coffee"
task :make_coffee do
cups = ENV["COFFEE_CUPS"] || 2
puts "Made #{cups} cups of coffee. Shakes are gone."
end
# see http://rake.rubyforge.org/classes/Rake/PackageTask.html
@brentjanderson
brentjanderson / adapter.js
Last active October 23, 2019 19:12
NOTE: Not updated since early 2013 - likely will not work with modern EmberData. Ember.JS, ember-data, and socket.io adapter. Not as primitive as the initial version and it supports object creation/deletion/etc. Does not support bulk updates like the first one just to keep it simple. Does support ember-data revision 11 and does support queries/f…
/*jshint browser:true */
/*global DS:true, io:true, App:true */
(function() {
'use strict';
// Initializer for Models
window.Models = {};
console.warn("Don't pollute the global namespace with Models!");
-- networktest to transmit data from vvvv to codea
-- jens.a.e — 18.01.2013
-- this example demostrates the connection to vvvv. it depends on a patch running
-- on the remote machine. it is easy to build:
-- the v4 patch contains just a lof -> asstring -> http(server)
-- the server should be set to text/plain to send the least amount
-- of data needed. thisna double in the patch. an int should be
-- even less to trans to transmit.