Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🍎
Makin' Cider & Writing Code

Aaron Kalin martinisoft

🍎
Makin' Cider & Writing Code
View GitHub Profile
@martinisoft
martinisoft / gist:1237739
Created September 23, 2011 15:57
rvm bash autocomplete issue
Last 4 lines of my .bashrc:
# RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# RVM Autocomplete
[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
Output when I type: rvm install [tab]
+ : 172 > export rvm_trace_flag=1
+ : 172 > rvm_trace_flag=1
+ : 177 > true 1 0 0 0 HOME=/Users/dev
+ : 181 > (( rvm_ignore_rvmrc == 0 ))
+ : 183 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
+ : 185 > [[ -s /etc/rvmrc ]]
+ : 183 > for rvmrc in /etc/rvmrc '"$HOME/.rvmrc"'
+ : 185 > [[ -s /Users/dev/.rvmrc ]]
+ : 187 > grep '^\s*rvm .*$' /Users/dev/.rvmrc
+ : 194 > source /Users/dev/.rvmrc
export rvm_project_rvmrc_default=1
export rvm_project_rvmrc=1
[ -f "$HOME/.rvmrc.local" ] && source "$HOME/.rvmrc.local"
@martinisoft
martinisoft / nginx
Created March 13, 2012 14:00
nginx init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@martinisoft
martinisoft / fix-nokogiri.md
Last active October 1, 2015 23:48
Nokogiri working install with latest XCode or you get "WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.7.8"

Homebrew has blacklisted libiconv so the majority of your help via google will not work now.
Here's a way I figured out how to get nokogiri to compile if you made the mistake of upgrading your XCode version

  1. Install packages via homebrew
brew update
brew install libxml2
brew install libxslt
@martinisoft
martinisoft / play-next.coffee
Created March 23, 2012 21:40
Play-Next Hubot Script
# Play music. At your office. Like a boss.
#
# NOTE:
# This uses the new version of play (the next branch currently)
# https://github.com/holman/play/tree/next
#
# Make sure you set up your HUBOT_PLAY_URL environment variable with the URL to
# your company's play.
#
# Controls
@martinisoft
martinisoft / ohai_network.json
Created September 3, 2012 05:52
ohai network output
[
[
"interfaces",
{
"lo": {
"mtu": "16436",
"flags": [
"LOOPBACK",
"UP",
"LOWER_UP"
@martinisoft
martinisoft / error.txt
Created October 9, 2012 19:15
cucumber suite error
$ rake clean spec cucumber --trace
** Invoke clean (first_time)
** Execute clean
rm -r pkg
rm -r tmp
rm -r ext
rm -r java/target
rm -r doc
rm -r /Users/martinisoft/projects/gherkin/tasks/../ragel/i18n/ar.java.rl
rm -r /Users/martinisoft/projects/gherkin/tasks/../ragel/i18n/lexer_common.ar.rl
@martinisoft
martinisoft / stack_trace
Created January 4, 2013 22:26
Stack trace when running Cucumber against jRuby 1.7.2
$ rake
Parser.java:184:in `<init>': java.lang.NullPointerException: uri
from Parser.java:69:in `pushMachine'
from Parser.java:56:in `parse'
from NativeMethodAccessorImpl.java:-2:in `invoke0'
from NativeMethodAccessorImpl.java:39:in `invoke'
from DelegatingMethodAccessorImpl.java:25:in `invoke'
from Method.java:597:in `invoke'
from JavaMethod.java:485:in `invokeDirectWithExceptionHandling'
from JavaMethod.java:340:in `invokeDirect'
@martinisoft
martinisoft / pidcheck.sh
Created January 7, 2013 21:33
Pidcheck script
#!/usr/bin/env bash
function is_process_alive {
set +e
if [ -n $1 ] && kill -0 $1 >/dev/null 2>&1; then
echo "yes"
fi
set -e
}