Storm Threequal js vs ruby
The E myth Org chart for yourself
QFD = ideas into actionable items
# table_stats User | |
# table_stats User, :email, :name | |
def table_stats(model, *fields) | |
old_logger = ActiveRecord::Base.logger | |
ActiveRecord::Base.logger = nil | |
fields = model.send :column_names if fields.empty? | |
model_count = model.send(:count) |
[ | |
[%w[c r u d], Widget], | |
].each do |tuple| | |
permissions = tuple[0].map!(&:to_sym) | |
model = tuple[1] | |
permissions.map! do |permission| | |
case permission | |
when :c then :create | |
when :r then :read |
# Variable before method | |
a = "A variable" | |
def a; "A method"; end | |
puts a # A variable | |
# Method before variable | |
def b; "B method"; end | |
b = "B variable" |
class Bicycle < ActiveRecord::Base | |
validate_presence_of :tire_quantity | |
def ride | |
pedal | |
brake | |
end | |
end |
(main)> class AttrTest | |
(main)> attr_accessor :accessor | |
(main)> attr_reader :reader | |
(main)> attr_writer :writer | |
(main)> | |
(main)> def initialize(accessor, reader, writer) | |
(main)> @accessor = accessor | |
(main)> @reader = reader | |
(main)> @writer = writer | |
(main)> end |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
<title>Popcorn</title> | |
<style type="text/css"> | |
body { | |
background: white url(popcorn.gif) no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; |
redis = require("redis").createClient() | |
io = require("socket.io-client") | |
RESULT_COUNT = process.argv[2] | |
DATA_LENGTH = process.argv[3] | |
channel = "channel#{Math.floor(Math.random() * 1024)}" | |
results = [] | |
console.log channel |