Skip to content

Instantly share code, notes, and snippets.

View szalansky's full-sized avatar
🎯
Focusing

szalansky

🎯
Focusing
View GitHub Profile
@szalansky
szalansky / gist:4610c0f88d4cb3160add
Created December 25, 2015 12:14
fresh os x setup
turn off hibernation (only unibody mbpro)
install iterm2 + thayer
install xcode
install vagrant + virtualbox
create vagrant machines
product = Product.find 123
product.title = “foo”
product.changed? # true
######
product = Product.find 123
product.title = “foo”
@szalansky
szalansky / show_jenkins_errors.bookmark
Last active August 29, 2015 14:26 — forked from christemple/show_jenkins_errors.bookmark
Bookmark: Show the errors in a Jenkins console output easier
javascript:var errors = jQuery('.console-output > span[style*="CD0000"]').clone(); jQuery('.console-output').empty(); jQuery('.console-output').append(errors); jQuery('.console-output > span').append("<br/>");
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDaIXuInNjokrzIcoN1tOrCgTu5n0FrQ2tWT8k/Sx3aiOO5FjXzuGdlbzsoujZFcqvSV/f9OQcGL8PAJJ2cNeoT+dkeN9IWsWlqK+/WTNIxb7E5P3/wDloL3hqPDPFMi1PScLI0nPjgnGEX5qiBIW54nXZL8DWc58mDk7xpv0jRigK1IkgcmhekxOVQPl7GCHtEbqhMqh3H0VOEVyWi/A+bTPIf2WyYWrDAzsRQRaT/iQJE8szHMH7215OVuvX0kVEAHyRzMhLzbf3ouK7NAM1Hh36R3H830gSNIj+h9WJFN2zH/9GF5uzvkWufZXMzUjVI/PRCDeaEgH0/LEzXhZXV [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0G7bNWK/A5eShY0gkGHo9+/zTIsjiWlFwNhC7oElV7vWt+8yyuR4iAeH19ET8P75nBZ6s5HsoQ803eVP2VjHA11GHeSStGn2IlrEkZMl+rE56zE/BWEjG11oWAeCdGkLS4B2XyhVjyg5FpRqxlBJbCmrqClNUD0ck5Rbf1Vk9WkMEldRyTl7eoCQEvXp8iK8ko+gBMlhWGtBCEzuhjgyyOdlTlhXpmWmN/OUDH2+pbSedsicpcLJYstZPwDrTuA1lKjejsIi962jGKPSWhgh9MsD02AvoUF5tEWx++b13pkyUCGyDJqK7kYrU+O2kMs7Mf4lFd9rJe8RsU4eY+d6t

Apple has changed how it distributes OS X Mavericks since its initial release in October 2013. This note was written on May 2, 2014. This affects the instructions you'll find online for how to make a bootable OS X installer.

It used to be that when you downloaded OS X from the App Store, the entire 5GB installer was placed in /Applications/Install OS X Mavericks.app. Now, there is a simple shortcut program placed in /Applications/OS X Mavericks.app. The app file is immediately removed in the event of an error or a successful post-install launch. When the download succeeds, the app file is launched which brings up the traditional install wizard, but this time mounted to /Volumes/Install OS X Mavericks.

I actually discovered this because if you already have a volume mounted of the same name (which I did, because I was trying to update my existing USB installer), the App Store download promptly fails right after finishing its download.

So if you have an empty disk you'd like to use as an installer that'

@szalansky
szalansky / gist:8860421
Created February 7, 2014 10:36
Mass assigning with PORO
# mass assign yay
args.each do |key, value|
m = "#{key}="
self.send(m, value) if self.respond_to?( m )
end
find DIR -print0 | xargs -0 -n 100 bundle exec rake TASK

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

@szalansky
szalansky / roman_numbers.rb
Created April 10, 2013 06:32
Roman numbers calculator (did as kata with Ruby and RSpec).
require "rspec"
CONVERSIONS_FACTOR = [
[100, "C"], [90, "XC"], [50, "L"], [40, "XL"], [10, "X"], [9, "IX"], [5, "V"], [4, "IV"], [1, "I"]
]
def conversion_factors_for number
CONVERSIONS_FACTOR.find { |arabic, _| arabic <= number }
end
def convert number