apt-get -y update
locale-gen en_GB.UTF-8
/usr/sbin/update-locale LANG=en_GB.UTF-8
aptitude -y safe-upgrade && aptitude -y full-upgrade
apt-get -y update
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
In a lot of languages callbacks are really common. You might call a function | |
with another function as an argument and at some point | |
in the body of the called function the callback function gets called. You said | |
this is done with pointers in C... not sure how | |
common this is there so bear with me. | |
# This is (psuedo-code) based on javascript where callbacks are really common | |
because it's asynchronous (i.e. you often need a callback to be notified when | |
the function you've called is complete). First two function definitions: |
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 'acceptance/support/acceptance_helper' | |
feature "Add manual timesheet to payroll report", %q{ | |
In order to tweak the payroll report | |
As an admin | |
I want to manually attach timesheets to the report | |
} do | |
background do | |
generate_full_payroll_data |
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
gem 'rake', '~> 0.8.7' |
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
# | |
# Cookbook Name:: crontab | |
# Definition:: crontab | |
# | |
#sets the crontab for a user | |
define :crontab, :username => :root, :filename => nil do | |
filename = params[:filename] |
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
rvm gemset create moof | |
rvm gemset use moof | |
rails new moof | |
cd moof | |
emacs Gemfile <- add rspec | |
bundle | |
rails g rspec:install | |
rake -T | |
<excerpt> |
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
def new | |
@timesheet = Timesheet.new | |
@timesheet.employee = Employee.find(params[:employee_id]) rescue nil | |
end |
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
CREATE DATABASE database_name CHARACTER SET utf8; | |
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost' IDENTIFIED BY 'your_password'; |
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
scenario "Payroll report" do | |
sign_in :then_visit => reports_payroll_path | |
save_and_open_page | |
visit timesheets_path | |
save_and_open_page | |
end |
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
class Object | |
def self.my_accessor(*accessor_names) | |
accessor_names.each do |name| | |
define_method name do | |
instance_var_name = "@#{name.to_s}".to_sym | |
self.instance_variable_get(instance_var_name) | |
end | |
writer_name = "#{name.to_s}=".to_sym | |
define_method writer_name do |value| | |
instance_var_name = "@#{name.to_s}".to_sym |