# install dependencies
$ sudo dnf install memcached redis
# start redis server
$ redis-server
# start memcached
$ service memcached start
πΆ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$start_time = Time.now.to_f | |
def stamp(label = '') | |
puts "%.3f\t%s" %[ | |
Time.now.to_f - $start_time, | |
label | |
] | |
end | |
stamp "start" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read about factories at https://github.com/thoughtbot/factory_girl | |
FactoryGirl.define do | |
factory :user do | |
sequence(:email) { |n| "example#{n}@example.com" } | |
sequence(:name) { |n| "name#{n}" } | |
sequence(:username) { |n| "username#{n}" } | |
password 'changeme' | |
password_confirmation 'changeme' | |
confirmed_at { Time.now } | |
biography <<-EOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe ConferenceController do | |
let(:user) { create(:user) } | |
describe 'testing user' do | |
it 'checks for admin user' do | |
expect(user.is_admin).to be_falsey | |
sign_in user | |
expect(controller.current_user).to be_truthy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git clone --depth 1 "$1" temp-linecount-repo && | |
printf "('temp-linecount-repo' will be deleted automatically)\n\n\n" && | |
cloc temp-linecount-repo && | |
rm -rf temp-linecount-repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -i :5000 | |
sudo kill -9 <pid> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\] \[\033[33;1m\]\w\[\033[m\] (\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \$ " | |
# gives me: | |
wayne ~/dev/lrn (master) $ # my name in green, curr dir in yellow, and branch in green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Aditya Prakash | |
email = [email protected] | |
[alias] | |
co = checkout | |
s = status | |
c = commit | |
lo = log --oneline -10 | |
l = log --oneline | |
p = push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Invoke db:create (first_time) | |
** Invoke db:load_config (first_time) | |
** Execute db:load_config | |
** Execute db:create | |
** Invoke db:drop (first_time) | |
** Invoke db:load_config | |
** Execute db:drop | |
** Invoke db:setup (first_time) | |
** Invoke db:schema:load_if_ruby (first_time) | |
** Invoke db:create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake test TEST=path_to_file |
OlderNewer