Skip to content

Instantly share code, notes, and snippets.

View jashank's full-sized avatar

Jashank Jeremy jashank

View GitHub Profile
@jashank
jashank / jove.pl
Created April 12, 2012 00:50
Planet Jupiter receiver
#!/opt/local/bin/perl -w
# jove -- listen to jupiter
#
# We get a constant 1ch s16le bitstream on <STDIN>. Not
# optimal, I know. We are constantly reading from the
# bitstream, in one of two modes:
# - in SLAB mode, the samples are then preserved, processed and
# dumped to outputs (logfile, slabfile, slabstat, quadfile).
# - in NOTSLAB mode, the samples are ignored. This also gives
# us some processing headroom.
@jashank
jashank / BinderItem.pm
Created June 24, 2012 03:50
Converting collection to individual
has 'Title' => (
isa => 'Scrivener::Title',
is => 'ro',
traits => [qw(XML)],
lazy => 1,
description => {
LocalName => "Title",
Prefix => "",
node_type => "child",
Name => "Title",
@jashank
jashank / .htaccess
Created July 11, 2012 07:36
Apache config
Options +FollowSymLinks
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ dispatch.cgi?/$1 [QSA,L]
# nicked from gportal, patched for Tingle
@jashank
jashank / spoons.rb
Created August 9, 2012 02:21
Nonsense values for selected_line
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'plist'
require 'curses'
#require 'mplayer'
class Library
def initialize()
@jashank
jashank / prefixdemo.pl
Created October 6, 2012 01:10
Dancer prefix bug: only the first of a set of side-by-side prefixes is accessible
#!/usr/bin/perl -w
use Dancer;
prefix '/a' => sub {
prefix '/b' => sub {
get '/foo' => sub { "Hello!" };
get '/bar' => sub { "Goodbye!" };
};
@jashank
jashank / dancer2test.pl
Created March 12, 2013 07:10
Dancer2::Test misbehaviour
#!/usr/bin/perl -w
use warnings;
use strict;
=head1 NAME
dancer2test.pl -- test code for Dancer2::Test
=head1 SYNOPSIS
@jashank
jashank / gist:5179273
Created March 17, 2013 02:23
Ruby SDL playback (as used in CMG)
# I initialise on L19-22
# let $SAMPLERATE be 48000; I'd like to do this more dynamically, eventually
SDL.init(SDL::INIT_AUDIO)
SDL::Mixer.open($SAMPLERATE, SDL::Mixer::DEFAULT_FORMAT, 2, 8192)
SDL::Mixer.allocate_channels(128)
# Inside the class Channel, I play audio on L68 (cherrypicking salient lines).
# Typically, there exist 64 Channels.
class Channel
attr_accessor :sdl, :num
@jashank
jashank / Makefile
Created June 26, 2013 23:20
GNU make is broken
PROJECT = foo
include project.mk
Sampling process 1656 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling TextMate (pid 1656) every 1 millisecond
Process: TextMate [1656]
Path: /Users/jashank/Downloads/TextMate.app/Contents/MacOS/TextMate
Load Address: 0x109042000
Identifier: com.macromates.TextMate.preview
Version: 2.0-alpha.9473 (9473)
Code Type: X86-64 (Native)
Parent Process: launchd [315]
@jashank
jashank / PKGBUILD.dbg
Last active December 31, 2015 14:59
The Chrominator
# $Id$
pkgname=chromium-trunk-dbg
provides=('chromium')
pkgver=38.0.2105.0.r285495
pkgrel=1
pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser"
arch=('i686' 'x86_64')
url="http://www.chromium.org/"
license=('BSD')