-
Ruby!
-
With Rails you focus on delivering value to your users. => Dave Thomas
-
Active Record {:amazing_syntax, :migration, }
-
Fast development => {:plugins, :generators}
-
Easy deploy => Capistrano
-
Convention over Configuration
-
Less code
-
Work agile
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 Node | |
attr_accessor :dad, :name | |
def initialize(name='', dad=nil) | |
@name, @dad = name, dad | |
end | |
def inspect | |
"My dad is #{@dad} " | |
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
# DictOptions is OrderedOptions copy for python. | |
# Basic idea: insted of use dict like this d['key'] = value use it as proprties d.key = value | |
# | |
# Examples: | |
# config = DictOptions() | |
# config.app_name = "Dictionary Test" | |
# config.database = "mysql" | |
# config.server = DictOptions() | |
# config.server.processes = 5 | |
# ... |
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 'net/ssh' | |
host = IO.readlines('test1.txt') # full path of servers' list | |
port = 22 # SSH port | |
user = 'root' # username | |
pass = "123123" # password | |
i = 0 | |
begin | |
cmd = ["sudo /sbin/ip addr | grep mtu | grep -v lo | awk '{print $2}'", # Interfaces |
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 'rubygems' | |
require 'win32ole' | |
require 'csv' | |
mdb_file="c:/Sites/labs/50q.bok" | |
class AccessDb | |
attr_accessor :mdb, :connection, :data, :fields, :catalog | |
def initialize(mdb=nil) |
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 'matrix' | |
require 'pp' | |
a = Matrix[ [1,2], [3,4]] | |
b = Matrix[ [4,3], [2,1]] | |
pp a | |
pp b |
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
# encoding: UTF-8 | |
require 'csv' | |
require 'json' | |
columns = %w(trackName trackViewUrl artistName version price releaseDate formattedPrice fileSizeBytes description) | |
exclude = [] # Here you can execlude list of urls you want | |
data = JSON.load(DATA.read) | |
puts data.count |
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 reinstall ruby-2.0.0-p0 --with-openssl-dir=$HOME/.rvm/usr --verify-downloads 1 --debug ruby-1.9.3-p385 user bbc8e58 ✗ | |
ruby-2.0.0-p0 - reinstall | |
Log file: /Users/ecleel/.rvm/log/ruby-2.0.0-p0/remove.src.log | |
[2013-02-27 10:53:16] __rvm_rm_rf | |
__rvm_rm_rf () { | |
__rvm_rm_rf_verbose "$@" | |
} | |
current path: /Users/ecleel/Codes/ | |
command(2): __rvm_rm_rf /Users/ecleel/.rvm/src/ruby-2.0.0-p0 | |
Removing /Users/ecleel/.rvm/src/ruby-2.0.0-p0... |
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
/** | |
* Circular Tooltip (SO) | |
* http://stackoverflow.com/q/13132864/1397351 | |
*/ | |
* { margin: 0; padding: 0; } | |
body { | |
overflow: hidden; | |
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg); | |
} | |
/* generic styles for button & circular menu */ |
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
/** | |
* Circular Tooltip (SO) | |
* http://stackoverflow.com/q/13132864/1397351 | |
*/ | |
* { margin: 0; padding: 0; } | |
body { | |
overflow: hidden; | |
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg); | |
} | |
/* generic styles for button & circular menu */ |
OlderNewer