Skip to content

Instantly share code, notes, and snippets.

Travis Tilley ttilley

Block or report user

Report or block ttilley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tupleToArray.swift
func tupleToArray<T, U>(var tuple: T, _ resultType: U.Type) -> [U] {
let count = sizeof(T) / sizeof(U)
return withUnsafePointer(&tuple) { ptr -> [U] in
let eltPtr = UnsafePointer<U>(ptr)
return Array(0..<count).map({ eltPtr[$0] })
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am ttilley on github.
  • I am ttilley (https://keybase.io/ttilley) on keybase.
  • I have a public key whose fingerprint is 8D25 C7B4 214E EC23 EA0F 84EF D2DF 823B EB38 15AC

To claim this, I am signing this object:

@ttilley
ttilley / build-llvm-projects-mac.sh
Last active Oct 13, 2015
build llvm svn and friends on mac
View build-llvm-projects-mac.sh
#!/usr/bin/env bash
set -e
xcsel='xcode-select --print-path'
xcodepath="$($xcsel)"
platform='MacOSX'
export TRIPLE='x86_64-apple-darwin11'
export MACOSX_DEPLOYMENT_TARGET='10.7'
View ree_tunable_compat.diff
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
View emlogger.rb
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
@ttilley
ttilley / arris_password_of_the_day_brute_force.rb
Created Sep 7, 2012
attempt to brute force an arris "password of the day" algorithm seed
View arris_password_of_the_day_brute_force.rb
require 'date'
require 'time'
require 'uri'
require 'net/http'
require 'typhoeus'
class PasswordOfTheDay
TABLE1 = [
[15, 15, 24, 20, 24],
@ttilley
ttilley / Vagrantfile
Created Jul 9, 2012
stackato vagrant bootstrap
View Vagrantfile
#!/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 / bdw-gc.rb
Created Jun 25, 2012
updated homebrew formula for Boehm-Demers-Weiser GC supporting building from head and passing in various options to the build
View bdw-gc.rb
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 / hello_world.txt
Created May 20, 2012
Peanut Butter Jelly Time brainfuck variant
View hello_world.txt
#!/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)
View JPlayerDuckPunch.coffee
top = this
top.logJPlayerCreate ?= true
top.logJPlayerPublishCreate ?= true
top.logAllJPlayerEvents ?= false
do ($ = jQuery) ->
if !$.subscribe
o = $({})
$.subscribe = ->
You can’t perform that action at this time.