Skip to content

Instantly share code, notes, and snippets.

View thewoolleyman's full-sized avatar

Chad Woolley thewoolleyman

View GitHub Profile
@thewoolleyman
thewoolleyman / _ruby_pty_cr_lf_example.txt
Last active January 16, 2017 06:42
ruby PTY turns LF into CF+LF
irb
2.3.3 :001 > puts `uname -a`
Darwin pima 15.6.0 Darwin Kernel Version 15.6.0: Wed Nov 2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64
=> nil
2.3.3 :002 > `printf "a\n"`.chars
=> ["a", "\n"]
2.3.3 :003 > require 'pty'; PTY.spawn('printf "a\n"')[0].read(3).chars
=> ["a", "\r", "\n"]
@thewoolleyman
thewoolleyman / .ruby-version
Last active January 16, 2017 05:30
thewoolleyman-ruby-pty-check
ruby-2.3.3
@thewoolleyman
thewoolleyman / fixed.txt
Last active January 14, 2017 05:18
debugging git-duet test suite on my machine...
# OK, after `brew uninstall git-duet` and manually adding absolute path to project bin
# (after `gb build`) the tests passed. Thought I had tried this before, but I guess not :)
± cw |master → origin ✓| → ls -al /usr/local/bin/git-duet*
ls: /usr/local/bin/git-duet*: No such file or directory
2015-11-23 21:54:11 ☆ |ruby-2.1.6| prudence in ~/go/src/github.com/thewoolleyman/git-duet
± cw |master → origin ✓| → export PATH=$PWD/bin:$PATH
2015-11-23 21:54:33 ☆ |ruby-2.1.6| prudence in ~/go/src/github.com/thewoolleyman/git-duet
@thewoolleyman
thewoolleyman / golang_notes.md
Last active November 20, 2015 23:50
golang_notes.md

golang notes

Env setup

  • GOROOT should be ~/go
  • Check out projects under ~/go/src/<github.com>/<github user>/<repo>

Jetbrains plugin

  • Install as plugin
@thewoolleyman
thewoolleyman / rails-new-bare
Created October 30, 2015 17:56
command to generate a barebones no-js no-db rails app
#!/usr/bin/env bash
rails new --skip-sprockets --skip-active-record --skip-javascript --skip-turbolinks --skip-test-unit $1
@thewoolleyman
thewoolleyman / xcode_homebrew_rvm_upgrade.md
Created May 2, 2012 23:57
xcode_homebrew_rvm_upgrade.md

Xcode Ruby Upgrade

  • App Store - install xcode

    • xcode preferences - downloads - Command line tools
  • backup and recreate homebrew

      sudo mv /usr/local /usr/local.bak
    

sudo mkdir /usr/local

Network Troublehooting

If you are having network problems, take a "divide and conquer" troubleshooting approach. So, think of the links in the network chain, and start trying to narrow down where the problem is. For example, if you can't load a webpage, here's the links you are going through:

A. Browser
B. Operating System (Windows or Mac OS)
C. Wireless or wired adapter on computer

D1. Wireless signal to access point (if you are on wireless), or

@thewoolleyman
thewoolleyman / chef_client_osx_bootstrap.sh
Created May 15, 2011 10:11
chef_client_osx_bootstrap.sh
#!/usr/bin/env bash
######
#
# Script to bootstrap an OSX workstation to use chef client (not chef solo)
# via an RVM-installed Ruby interpreter (not the OSX system default ruby)
#
#
# Override RVM version with $rvm_version
# Override RVM Ruby Interpreter install version/options with $ruby_version
@thewoolleyman
thewoolleyman / selenium-rc-if-needed.bash
Created December 6, 2010 16:19
Start selenium-rc if needed
#!/usr/bin/env bash
export SELENIUM_SERVER_PORT=4444
process_id=$(lsof -i tcp:$SELENIUM_SERVER_PORT -Fp|tr -d p)
if [ $process_id ] ; then
echo "Selenium server is already running"
else
selenium-rc &
echo "New Selenium server started"