Skip to content

Instantly share code, notes, and snippets.

@ttilley
ttilley / htman.sh
Created December 28, 2011 23:46
open man page in browser on mac
function htman() {
TMPPATH="${TMPDIR:=/tmp/}${@}$RANDOM.html"
groffer --html --html-viewer-tty=cat -- ${@} > "${TMPPATH}"
[[ "$?" == "1" ]] && return 1
${BROWSER:=/usr/bin/open} "${TMPPATH}"
}
@ttilley
ttilley / gist:1737625
Created February 4, 2012 12:42
mac sandbox and code signing conveniences
//
// CodeSignConveniences.h
//
// Created by Travis Tilley on 2/4/12.
// Copyright (c) 2012 Travis Tilley. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Security/CodeSigning.h>
#!/usr/bin/env bash
LLVM_SVN='http://llvm.org/svn/llvm-project/llvm/trunk'
CLANG_SVN='http://llvm.org/svn/llvm-project/cfe/trunk'
POLLY_SVN='http://llvm.org/svn/llvm-project/polly/trunk'
COMPILER_RT_SVN='http://llvm.org/svn/llvm-project/compiler-rt/trunk'
LIBCXX_SVN='http://llvm.org/svn/llvm-project/libcxx/trunk'
export BASE=`pwd`
export LLVM_SRC="${BASE}/llvm"
top = this
top.logJPlayerCreate ?= true
top.logJPlayerPublishCreate ?= true
top.logAllJPlayerEvents ?= false
do ($ = jQuery) ->
if !$.subscribe
o = $({})
$.subscribe = ->
@ttilley
ttilley / hello_world.txt
Created May 20, 2012 05:27
Peanut Butter Jelly Time brainfuck variant
#!/usr/bin/env PeanutButterJellyTime
# -----------------------------------------------------------------------------
# keyword => C equiv (description)
# -----------------------------------------------------------------------------
# peanut => ++*ptr (increase value of cell)
# PEANUT => ++ptr (move to next cell)
# butter => --*ptr (decrease value of cell)
# BUTTER => --ptr (move to previous cell)
# jelly => putchar(*ptr) (print character value of cell)
# JELLY => *ptr=getchar() (store numeric value of char input in cell)
@ttilley
ttilley / bdw-gc.rb
Created June 25, 2012 17:45
updated homebrew formula for Boehm-Demers-Weiser GC supporting building from head and passing in various options to the build
require 'formula'
class Formula
def configure_path_args(choices={})
vars = {
:prefix => self.prefix,
:'exec-prefix' => self.prefix,
:bindir => self.bin,
:sbindir => self.sbin,
:libexecdir => self.libexec,
@ttilley
ttilley / Vagrantfile
Created July 9, 2012 16:26
stackato vagrant bootstrap
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
Vagrant::Config.run do |config|
config.package.name = 'vagrant-stackato.box'
config.vm.guest = :ubuntu
config.ssh.forward_agent = true
# config.vm.forward_port 80, 8080, :name => "nginx", :protocol => :tcp, :auto => true
# config.vm.forward_port 443, 8443, :name => "nginx ssl", :protocol => :tcp, :auto => true
@ttilley
ttilley / arris_password_of_the_day_brute_force.rb
Created September 7, 2012 07:57
attempt to brute force an arris "password of the day" algorithm seed
require 'date'
require 'time'
require 'uri'
require 'net/http'
require 'typhoeus'
class PasswordOfTheDay
TABLE1 = [
[15, 15, 24, 20, 24],
require 'eventmachine'
require 'digest/md5'
require 'fiber'
require 'thread'
unless defined?(ActiveSupport)
class String; def blank?; self !~ /[^[:space:]]/; end; end
class NilClass; def blank?; true; end; end
class Object; def blank?; false; end; end
diff --git c/gc.c w/gc.c
index 861379b..2f4d596 100644
--- c/gc.c
+++ w/gc.c
@@ -86,11 +86,13 @@ void *alloca ();
#endif
#define HEAP_MIN_SLOTS 10000
#define FREE_MIN 4096
+#define HEAP_SLOTS_GROWTH_FACTOR 1.8