Skip to content

Instantly share code, notes, and snippets.

@kaplan
kaplan / middleman_dev_approaches.md
Last active May 12, 2016 11:42
Local development setup approaches for Middleman with Pow or Apache with the Mac OS.

Middleman Local Dev Approaches

Update 03-03-2015
I've moved over to a new MacBookPro running 10.10.2. I think I'm going to leave POW off this machine. I've been trying to use more Vagrant VMs in general, but the Localhost is so fast for just getting something in the browser, especially when testing things out on the front end in the browser. One thing I'm noticing about the 2nd approach is that the build with a vhost works great, but just getting the .git setup was a little tricky. I had to make the main directory, the build directory and git init in each. Then, I added the remotes from the working (development) repository for the source and the staging server repo for the build. Looks like I might install Passenger on this new machine so that I can use a vhost for the source files. Otherwise I need to use the http://0.0.0.0:4567/ or http://localhost:4567/ which isn't a bad thing vs installing Passenger?

Udpate 03-03-2015
Wow, just installed Phusion Passenger in about 15min using the g

@kaplan
kaplan / scary_craps_revised.rb
Created August 14, 2013 03:08
A revised, non-recursive version of the scary_craps.rb file. This needs to run in the terminal b/c there's a chomp for the rolling again after a point is set. Before I was just hitting command + b to run it in Sublime Text2.
class Die
def roll_die
rand(1..6)
end
end
class CrapsShooter
attr_accessor :point, :dice_roll, :game_over
def crap_out?
@kaplan
kaplan / scary_craps.rb
Last active December 20, 2015 19:08
Scary Craps
class Die
def roll_die
rand(1..6)
end
end
class CrapsGame
attr_accessor :point, :dice_roll
def pass
@kaplan
kaplan / MntLion_User_Migration.markdown
Last active December 15, 2015 21:39
PHP/MySQL, Virtual Hosts Mountain Lion Setup from a user migration. Clean install on a new hard drive using a Mountain Lion bootable drive for MacOS install and a Time Machine ext. hd for the User Migration

###Basic setup outline (This may be wrong but it roughly contains everything you've been doing. Check the references for more info.)

  • Enable PHP and vhosts in the httpd.conf file
  • Set the permissions on the default /Library/WebServer/Documents
  • Start Apache
  • Test with the localhost in the browser
  • Make the username.conf file and set the default directory to the /Users/username/Sites/
  • Restart Apache
  • Edit PHP config to work with MySQL
  • Fix the permissions on the existing user MySQL
@kaplan
kaplan / MacVim_RVM_Ruby.markdown
Last active December 15, 2015 10:39
MacVim with RVM and Ruby 1.9.3

Install MacVim with RVM and Ruby 1.9.3

Problem: I wanted to use Vim in the Terminal (or MacVim) with Command-T and my RVM Ruby version.

Command-T documentation says it should be built using the Ruby version you intend to use in Vim/MacVim (System is recommended).

I could get the Homebrew installed version of Vim setup with my Ruby 1.9.3 along with Command-T in 1.9.3, but couldn't make it work for MacVim. So, if I tried to used Command-T in MacVim I got the Caught deadly signal SEGV error.

Originally I tried to install MacVim using Homebrew, but then in MacVim :ruby puts RUBY_VERSION will show 1.8.7 even though the brew install was done with my RVM's Ruby set to 1.9.3

I decided after asking on stackoverflow and learning about how to see mvim --version and vim --version and the Linking: to try a non brew install using the [build guide for MacVim](https://github.com/b4wi

@kaplan
kaplan / tmux_cheatsheet.markdown
Last active May 14, 2021 01:51
My most commonly used tmux commands and reference sites for learning tmux

tmux handy commands and references

####sessions

tmux new -s session_name      # new session by name
tmux attach -t session_name     # attach session by name (you can also use a instead of attach)
tmux switch -t session_name     # switch session by name (you can also use a instead of attach)
tmux list-sessions              # list existing sessions
bind-key : new -s session_name  # new session from within a session  
// detach
tmux detach # detach currently attached session