Skip to content

Instantly share code, notes, and snippets.

View tmm1's full-sized avatar

Aman Karmani tmm1

View GitHub Profile
#include <stdlib.h>
#include <stdio.h>
#include <ruby.h>
#include <node.h>
#include <oboe/oboe.h>
oboe_reporter_t udp_reporter;
#ifdef RUBY_GC_EVENT_ALL
// requires https://github.com/tmm1/brew2deb/blob/master/packages/ruby/patches/gc-hooks.patch
@tmm1
tmm1 / elitedesktop.md
Created April 9, 2012 08:00
How to pimp your linux

THIS ASSUMES YOU RUN DEBIAN (or ubuntu, mint) AND ARE NOT A SUCKA MC

XDM

sudo aptitude install xdm
sudo echo '/usr/bin/xdm' > /etc/X11/default-display-manager

spectrwm, dmenu

sudo aptitude install dmenu libxtst-dev
git clone git://opensource.conformal.com/spectrwm.git
cd spectrwm/linux

diff --git a/ext/ruby_http_parser/ruby_http_parser.c b/ext/ruby_http_parser/ruby_http_parser.c
index 119d7e1..5650652 100644
--- a/ext/ruby_http_parser/ruby_http_parser.c
+++ b/ext/ruby_http_parser/ruby_http_parser.c
@@ -320,6 +320,9 @@ VALUE Parser_execute(VALUE self, VALUE data) {
size_t nparsed = ryah_http_parser_execute(&wrapper->parser, &settings, ptr, len);
if (wrapper->parser.upgrade) {
+ if (RTEST(wrapper->stopped))
+ nparsed += 1;
require 'formula'
class Swfmill < Formula
# Staying on 3.0 until this 3.1 issue is fixed:
# https://bugs.launchpad.net/swfmill/+bug/611403
url 'http://swfmill.org/releases/swfmill-0.3.0.tar.gz'
homepage 'http://swfmill.org'
md5 'b7850211cf683aa7a1c62324b56e3216'
depends_on 'pkg-config' => :build
@tmm1
tmm1 / gist:1306811
Created October 23, 2011 03:07
brew2deb graphite package
tmm1@aux1:~/brew2deb/packages/graphite$ ls
formula.rb graphite-web init.d-carbon init.d-graphite init.d-statsd patches statsd.rb
tmm1@aux1:~/brew2deb/packages/graphite$ ../../bin/brew2deb
==> Cloning https://github.com/tmm1/graphite.git
Cloning into /home/tmm1/brew2deb/packages/graphite/src/graphite.git...
remote: Counting objects: 10564, done.
remote: Compressing objects: 100% (3731/3731), done.
remote: Total 10564 (delta 7061), reused 10137 (delta 6634)
Receiving objects: 100% (10564/10564), 15.56 MiB | 23.65 MiB/s, done.
@tmm1
tmm1 / dpkg.rb
Created September 13, 2011 02:40 — forked from benburkert/dpkg.rb
homebrew formula to get dpkg working a mac
require 'formula'
class Dpkg <Formula
url 'http://ftp.de.debian.org/debian/pool/main/d/dpkg/dpkg_1.16.0.3.tar.bz2'
homepage 'http://en.wikipedia.org/wiki/Dpkg'
md5 '0266b06ef9da8278cea008d21e17e5f6'
depends_on 'gnu-tar'
# depends_on 'cmake'
Jun 23, 2011 12:16:12 AM org.apache.solr.common.SolrException log
SEVERE: java.io.IOException: Bad file descriptor
at java.io.RandomAccessFile.close0(Native Method)
at java.io.RandomAccessFile.close(RandomAccessFile.java:543)
at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput$Descriptor.close(SimpleFSDirectory.java:78)
at org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.close(NIOFSDirectory.java:108)
at org.apache.lucene.index.CompoundFileReader.close(CompoundFileReader.java:139)
at org.apache.lucene.index.SegmentCoreReaders.decRef(SegmentCoreReaders.java:191)
at org.apache.lucene.index.SegmentReader.doClose(SegmentReader.java:387)
at org.apache.lucene.index.IndexReader.decRef(IndexReader.java:242)
@tmm1
tmm1 / 0-INSTALL.md
Created March 28, 2011 10:33
use cycript to load js enhancers into the propane transcript window

install cycript

brew install https://gist.github.com/raw/890258/cycript.rb

download the cycript hack

wget https://gist.github.com/raw/890258/hack_propane.js
chmod +x hack_propane.js

inject hack into running propane process

class Numeric
def commify
to_s.reverse.gsub(/(\d\d\d)(?=\d)(?!\d*\.)/,'\1,').reverse
end
end
require 'rubygems'
require 'yajl'
tests = []
module CpuProf
require 'ffi'
extend FFI::Library
ffi_lib FFI::CURRENT_PROCESS
begin
attach_function :start, :ProfilerStart, [:string], :void
attach_function :stop, :ProfilerStop, [], :void
rescue FFI::NotFoundError => e
STDERR.puts "*** Are you sure you preloaded libprofiler?"