Skip to content

Instantly share code, notes, and snippets.

View tekwiz's full-sized avatar

Travis D. Warlick, Jr. tekwiz

View GitHub Profile
@tekwiz
tekwiz / 1 Overview.md
Created May 24, 2011 17:40
Gemfile.lock Platform Conflicts

Problem: Gemfile.lock was generated on Windows machine (mingw), but on the OS X machine, the mingw gems are removed from the lockfile (and the platform "unknown" is added).

Bundler Version: All developers on are on bundler 1.0.13
Ruby Version: 1.8.7-p174 (OS X) and 1.8.7-p330 (Windows)
RVM Version: 1.2.4 (OS X), no RVM on Windows
Bundle Config: no settings

@tekwiz
tekwiz / bundler_git_path_fix.rb
Created May 27, 2011 20:25
Fix Bundler with git repo gems in the system path
module Bundler
module Source
class Git < Path
def path
@install_path ||= begin
if Bundler.requires_sudo?
Bundler.user_bundle_path.join(Bundler.ruby_scope).join(git_scope)
else
Bundler.install_path.join(git_scope)
end
class Semaphore
def initialize(limit)
@main, @internal = Mutex.new, Mutex.new
@mutexes = limit.times.collect { Mutex.new }
end
def synchronize
# create the mutex variable for scope
# grab the current thread for sleeping if necessary later
mutex, thread = nil, Thread.current
@tekwiz
tekwiz / circuit_formats.rb
Created October 2, 2012 17:01
Circuit Formats
module Circuit
FORMAT_EXT_REGEXP = /\.([^\.]+)$/
module Validators
silence_warnings do
SLUG_REGEXP = /\A(?:[-_!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[-_!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*\Z/
end
class SlugValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
@tekwiz
tekwiz / README.md
Last active December 10, 2015 21:18
Fixer for iWeb problems

IWFixer

The iwfixer.js file contents should be appended at the very bottom of the iWebSite.js script in the iWeb application. This will then become minified with the iWebSite.js file when any iWeb site is published.

Compatibility

This is only known to work with iWeb 3.0; however, only the

@tekwiz
tekwiz / 0-AWS_S3_Snippets.md
Last active December 11, 2015 00:18
S3 Website Bucket Policy
@tekwiz
tekwiz / git-backup
Created June 3, 2013 21:04
Git Backup
#!/usr/bin/env ruby
require "tmpdir"
require "fileutils"
PWD_ORIG = Dir.pwd
TMP_DIR = Dir.mktmpdir("git-backup")
def remote_basename
if ARGV[0] =~ /\.git$/
@tekwiz
tekwiz / rmate-setup.sh
Last active January 2, 2016 10:19
Download & setup rmate
#!/usr/bin/env bash
##
# Run with:
#
# curl -sSL https://gist.github.com/tekwiz/8289262/raw/rmate-setup.sh | bash -s
#
mkdir -p ~/bin
curl -Lo ~/bin/rmate https://raw.github.com/textmate/rmate/master/bin/rmate
@tekwiz
tekwiz / .mongorc.js
Created January 27, 2014 14:23
Mongorc Pretty Output
Prompt = {
cmdCount: 1,
host: function() {
if(db.serverStatus().ok == false) {
if(db.serverStatus().errmsg == "need to login") {
return "unauthorized";
} else {
return "error"
}
@tekwiz
tekwiz / 00-README.md
Last active December 30, 2016 16:13
Node.js 6 global console scope issue

Node.js 6 global console scope issue

The assignment to console.debug on console-scope-test.js:13 seems to be overriding the assignment on console-scope-test2.js:9, but the strict-equals assertions seem inconsistent.

Run:

NODE_DEBUG=scope1,scope2 node console-scope-test.js

Outputs: