sudo aptitude install debootstrap coreutils util-linux e2fsprogs
df -h
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf
File locations:
nginx.conf to /usr/local/etc/nginx/default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-availablehomebrew.mxcl.nginx.plist to /Library/LaunchDaemons/Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
| # spec/lib/tasks/notification_rake_spec.rb | |
| require 'spec_helper' | |
| describe 'notifications:weekly' do | |
| include_context "rake" | |
| let(:users){ [double(:user)] } | |
| let(:user_deliveries){ double(:user_deliveries) } | |
| before{ User.stub(:all).and_return( users ) } |
One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.
At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:
| # Sample implementation of quicksort and mergesort in ruby | |
| # Both algorithm sort in O(n * lg(n)) time | |
| # Quicksort works inplace, where mergesort works in a new array | |
| def quicksort(array, from=0, to=nil) | |
| if to == nil | |
| # Sort the whole array, by default | |
| to = array.count - 1 | |
| end |
| ;; paths | |
| (if (not (getenv "TERM_PROGRAM")) | |
| (let ((path (shell-command-to-string | |
| "$SHELL -cl \"printf %s \\\"\\\$PATH\\\"\""))) | |
| (setenv "PATH" path) | |
| (setq exec-path (split-string path ":")))) | |
| ;;remove vc-git | |
| (setq vc-handled-backends ()) |
| var FB = {}; | |
| FB.api = function(location, callback){}; | |
| FB.getLoginStatus = function(callback){}; | |
| FB.init = function(options){}; | |
| FB.login = function(callback, scope){}; | |
| FB.logout = function(callback){}; | |
| FB.Event = {}; | |
| FB.Event.subscribe = function(evt, callback){}; |
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb$ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl$ powssl| ;; This are setting for nice tabbar items | |
| ;; to have an idea of what it looks like http://imgur.com/b0SNN | |
| ;; inspired by Amit Patel screenshot http://www.emacswiki.org/pics/static/NyanModeWithCustomBackground.png | |
| ;; Tabbar | |
| (require 'tabbar) | |
| ;; Tabbar settings | |
| (set-face-attribute | |
| 'tabbar-default nil | |
| :background "gray20" |