Skip to content

Instantly share code, notes, and snippets.

desc "Renaming Rails App"
task :rename, [:message] => :environment do |t, args|
file_names = %w{config/application.rb
config/environment.rb
config.ru
Rakefile
config/routes.rb
config/environments/development.rb
config/environments/production.rb
config/environments/test.rb
var mockAjax = function() {
beforeEach(function() {
jasmine.Ajax.install();
})
afterEach(function() {
jasmine.Ajax.uninstall();
})
}
var lastRequest = function() {
return jasmine.Ajax.requests.mostRecent();
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
all programs / programming languages / software 3 kinds of artifacts and 1 quality
- data
x = 123
y = "hello"
z = true
my_name = gets.chomp
- decisions

A typical module looks like this:

module M
  def self.included(base)
    base.extend ClassMethods
    scope :disabled, where(:disabled => true)
  end

  module ClassMethods
 ...
[
{ "keys": ["shift+tab"], "command": "auto_complete" },
{ "keys": ["super+alt+]"], "command": "align_assignments" },
{ "keys": ["ctrl+shift+j]"], "command": "join_lines" },
{ "keys": ["super+alt+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"} },
{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar" },
{ "keys": ["ctrl+shift+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+t"], "command": "goto_recent" },
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+ctrl+w"], "command": "close_all" },

Definitions

General Testing

  • TDD Test Driven Development. Write examples before implementation.
  • BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
  • RSpec (mention alternatives, write a simple hand sewn test)

Testing Terms

@edshadi
edshadi / db_backup_script
Created February 10, 2012 18:38
mongo and mysql backup to s3 script
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= "development"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 's3_file_methods'
require "fileutils"
def run(command)
result = system(command)
raise("error, process exited with status #{$?.exitstatus}") unless result