Create a sym link between the application and a folder.
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
Make sure that folder is included in your .bash_profile export PATH
Create a sym link between the application and a folder.
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
Make sure that folder is included in your .bash_profile export PATH
# adapted from | |
# http://adamniedzielski.github.io/blog/2014/11/25/my-take-on-services-in-rails/ | |
class CreateUserAccount | |
attr_reader :user | |
def initialize(send_email_service: SendEmail.new, generate_token_service: GenerateToken.new) | |
@send_email_service = send_email_service | |
@generate_token_service = generate_token_service | |
end |
sudo apachectl -t |
You can use this query to show the size of a table: | |
SELECT table_name AS "Table", | |
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "$DB_NAME" | |
AND table_name = "$TABLE_NAME"; | |
or this query to list the size of every table in the database, largest first: | |
SELECT table_name AS "Tables", |
ALTER TABLE mytable CONVERT TO CHARACTER SET utf8 collate utf8_unicode_ci; |
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.
B = before | |
A = after | |
grep -B [number of lines] -A [number of lines] [search string] [file] | |
If you want the same number of lines before and after you can use -C num. | |
grep -C [number of lines] [search string] [file] | |
# get the submodule initially | |
git submodule add ssh://bla submodule_dir | |
git submodule init | |
# time passes, submodule upstream is updated | |
# and you now want to update | |
# change to the submodule directory | |
cd submodule_dir |
kill $(ps aux | grep '[d]elayed_job' | awk '{print $2}') | |
Credit: | |
http://stackoverflow.com/questions/3510673/find-and-kill-a-process-in-one-line-using-bash-and-regex |
$ du -sh /path/to/dir/*/ | |
48K /path/to/dir/dir1/ | |
4.0K /path/to/dir/dir2/ | |
6.7M /path/to/dir/dir3/ | |
20K /path/to/dir/dir4/ | |
8.0K /path/to/dir/dir5/ | |
44K /path/to/dir/dir6/ | |
Credit to http://superuser.com/questions/171534/list-the-current-folder-folders-sizes-with-the-terminal/171553#171553?newreg=0e154f897f58423793e8e11fe72e4c1f |