Skip to content

Instantly share code, notes, and snippets.

View blt04's full-sized avatar

Brandon Turner blt04

  • Rapid7
  • Austin, TX
View GitHub Profile
@blt04
blt04 / _README
Last active August 29, 2015 14:07
RVM 1.25.29 breaks git tab completion
See https://github.com/wayneeseguin/rvm/issues/3076
My envioronment:
* OSX with homebrew
* ZSH 5.0.6 (installed via homebrew)
* git 2.1.1 (installed via homebrew)
* RVM 1.25.33 (installed via curl from rvm.io)
* fpath automatically set to: /usr/local/share/zsh/site-functions /usr/local/Cellar/zsh/5.0.6/share/zsh/functions
* Files:
@blt04
blt04 / Cucumber_JSON_Expanded_Formatter_README.md
Last active April 25, 2016 05:27
Cucumber JSON "expanded" formatter (expands Scenario Outlines)

Cucumber JSON Expanded formatter

This is similar to the built-in Cucumber JSON formatter except it expands scenario outlines so each row is reported with its result. Thus, scenario outlines appear similar to regular scenarios in the JSON output.

This supports regular mode and "--expand" mode. In both cases, scenario outline tables are expanded (however the underlying logic for doing the expansion varies greatly).

@blt04
blt04 / ip-down
Created July 27, 2013 05:46
OSX VPN Scripts: The built in Mac VPN client doesn't have too many options but you can easily apply custom settings via scripts. Here are some examples of how to customize your VPN connections. Just put these two files in /etc/ppp and customize. Make sure you `chmod 0755 /etc/ppp/ip-up /etc/ppp/ip-down`. For more information, see `man pppd`.
#!/bin/bash
#
# /etc/ppp/ip-down
#
# When the ppp link goes down, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
@blt04
blt04 / ember-options.js
Created May 23, 2012 17:43
Disable deprecated features in Ember
ENV = {};
ENV.CP_DEFAULT_CACHEABLE = true;
ENV.VIEW_PRESERVES_CONTEXT = true;
@blt04
blt04 / ember_0.9.7_download_diff
Created April 18, 2012 23:38
Compiled ember on the left, downloads ember on the right
diff --git a/vendor/ember.js b/vendor/ember.js
index fdfbd5b..afbb2e4 100644
--- a/vendor/ember.js
+++ b/vendor/ember.js
@@ -1737,7 +1737,7 @@ if ('undefined' === typeof Ember) {
/**
@namespace
@name Ember
- @version 0.9.7
+ @version 0.9.6
@blt04
blt04 / gist:2231336
Created March 28, 2012 23:02
gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
@blt04
blt04 / gist:1607809
Created January 13, 2012 18:01
Security.allowDomain sub-domain support
// Allow thinkwell.com and thinkwell.com subdomains
// The current domain is automatically added. The AllowDomain flash
// var can be used to add an additional domain.
private function setAllowDomains():void{
// Only apply allowdomain security settings to thinkwell.com and subdomains
var pattern:RegExp = /^(.*\.)?thinkwell\.com$/
var allowDomains:Array = new Array();
// Try to add the current domain
try {
@blt04
blt04 / 20110624183946_create_example_tables.rb
Created June 24, 2011 19:12
ActiveRecord self-referential many-to-many relationships with extra attributes
class CreateExampleTables < ActiveRecord::Migration
def self.up
create_table :masters do |t|
t.string :fname
t.string :lname
t.timestamps
end
create_table :master_relations do |t|
@blt04
blt04 / mongoid_manual_versioning.rb
Created January 27, 2011 16:40
Manual Versioning for Mongoid 2.0
module Mongoid #:nodoc:
# Include this module to get manual versioning of root level documents.
# This will add a version field to the +Document+ and a has_many association
# with all the versions contained in it.
# Unlike Mongoid::Versioning, you must manually increment the version field
# when you want to bump versions
module Versioning
module Manual
extend ActiveSupport::Concern
include Mongoid::Versioning
@blt04
blt04 / mongoid_serialization.rb
Created December 16, 2010 18:52
Mongoid::Document XML and JSON serialization customizations
#
# This core extension customizes XML and JSON serialization in Mongoid::Document
# objects:
# * Serializes BSON::ObjectIDs as strings in XML
# * Removes leading underscores from attributes (such as _id, _type)
# * Allows documents to customize serialization even further by declaring a
# `serialize_attributes!` method, e.g.:
# def serialize_attributes!(attribute_hash)
# attribute_hash.delete(:unnecessary_key)
# attribute_hash[:password] = ''