Skip to content

Instantly share code, notes, and snippets.

@fizx
fizx / dmx.pde
Last active August 29, 2015 14:26
#include <Adafruit_NeoPixel.h>
#include <lib_dmx.h> // deskontrol library
#define DMX512 0
#define PIN 12 // Arduino data pin for the WS2812s
#define DELAY 10 // Millis to sleep each loop
#define CLUSTER_SIZE 12 // Size of each LED ring
#define CLUSTERS_COUNT 30 // Number of LED rings
#define DMX_GROUPS 12 // Number of RGB inputs received via DMX... will interpolate these values into the clusters
// DMX_CHANNELS = DMX_GROUPS * 3(for RGB) + 1 effect channel
qt.qpa.input: evdevmouse: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x1|0x2)
qt.qpa.input: Found matching devices ("/dev/input/event3", "/dev/input/event2")
qt.qpa.input: Adding mouse at "/dev/input/event3"
qt.qpa.input: create mouse handler for "/dev/input/event3" ""
qt.qpa.input: Adding mouse at "/dev/input/event2"
qt.qpa.input: create mouse handler for "/dev/input/event2" ""
qt.qpa.input: Initializing tslib plugin "TsLib" ""
qt.qpa.input: tslib device is "/dev/input/event2"
[info] - should respond with error
Feb 05, 2014 2:13:41 PM com.twitter.logging.Logger log
ERROR: Internal Server Error
com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->com.fasterxml.jackson.databind.MappingJsonFactory["codec"]->com.omc.corona.anon$1["factory"]->
#!/bin/sh
# clear old pipe and lock
rmdir worklock 2>/dev/null
rm work
if [[ ! -p work ]]; then
mkfifo work
else
dd if=work of=/dev/null
@fizx
fizx / foo.txt
Last active December 31, 2015 13:39
We couldn’t find that file to show.
@fizx
fizx / redis.go
Last active December 17, 2015 13:29
package main
/**
* This is a little too permissive (and hacked together), but it illustrates
* the point of encoding a bufio.Scanner that is stateful, so that it can
* parse the redis protocol.
*/
import (
"bufio"
@fizx
fizx / leaktest2.go
Last active December 16, 2015 00:29
package main
func main() {
buf := make([]int, 0)
buf = append(buf, 0, 1, 2, 3)
sub := buf[0:2] //hang on to a reference of the beginning of the vector
for {
for i := 0; i < 1000; i++ {
buf = append(buf, i)
}
package main
func main() {
buf := make([]int, 0)
for {
for i := 0; i < 1000; i++ {
buf = append(buf, i)
}
buf = buf[999:1000]
}
require 'socket'
server = TCPServer.new ENV["PORT"]
loop do
client = server.accept
client.puts "Hello !"
client.puts "Time is #{Time.now}"
client.close
end
@fizx
fizx / next_task.rb
Last active December 12, 2015 07:28
#!/usr/bin/env ruby
require "open-uri"
require "rubygems"
require "json"
unless ENV["ASANA_API_KEY"]
puts "please set ASANA_API_KEY in the env"
exit 1
end