Skip to content

Instantly share code, notes, and snippets.

View Neurogami's full-sized avatar

Neurogami Neurogami

View GitHub Profile
// ==UserScript==
// @name Remove annoying Hangouts promot
// @include https://news.google.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==
//var divPromo = document.evaluate('//div[@class="hangouts-promo"]', document, null, typeXPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
class Config {
JSONObject json;
Config(String cfgFile) {
json = loadJSONObject(cfgFile);
}
String getValue(String k) { return json.getString(k); }
String getString(String k) { return json.getString(k); }
import java.util.Map;
import java.util.Iterator;
class Configgy {
String[] configTextLines;
JSONObject json;
Configgy(String configFile) {
try {
# Add this as a board item to the "boards.txt" file for arcore
flora.name=Adafruit Flora (arcore)
flora.upload.protocol=avr109
flora.upload.maximum_size=28672
flora.upload.speed=57600
flora.upload.tool=avrdude
flora.upload.disable_flushing=true
flora.bootloader.low_fuses=0xff
flora.bootloader.high_fuses=0xd8
flora.bootloader.extended_fuses=0xcb
function sysex_handler(message)
local s = ""
for i = 4, #message-1 do
s = s..string.char(message[i])
end
local args = {}
for arg in s:gmatch("%S+") do
local devices = renoise.Midi.available_input_devices()
for i = 1, #devices do
if string.find(devices[i], "Teensy MIDI NG") then
renoise.Midi.create_input_device(devices[i],
midi_handler,
sysex_handler)
end
end
function clamp_value(value, min_value, max_value)
return math.min(max_value, math.max(value, min_value))
end
function handler_schedule_loop(args)
local rstart = tonumber(args[1])
local rend = tonumber(args[2])
local song = renoise.song
#!/usr/bin/env ruby
# Assumes you have ImageMagick installed
class MakeAverages
def initialize base_name, ext, grouping, prefix = 'avg_'
@base_name = base_name
@ext = ext
/*
An example sketch to show how to configure a WiFly RN XV with a Teensy 3.1.
For this example, the Teensy board was mounted on a breadboard, powered over USB.
Teensy GND and Vin are wired to + and - on the breadboard.
Teensy pins 7 and 8 (RX3 and TX3) are connected to the WiFly's pins 2 and 3 (TXD and RXD).
// <Arduino.h> is needed so that "settings.h" can refer to the String type.
// It just so happens that "RNXV.h" will load <Arduino.h> so we can skip
// the call here if we load "RNXV.h" first.
// #include <Arduino.h>
#include "RNXV.h"
#include "settings.h"
int led = 13; // For Teensy 3.1
int ts = 0;