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
## before | |
def some_method | |
Tweet.all.each do |tweet| | |
tweet.parse | |
end | |
end | |
## after | |
def some_method | |
Tweet.all.each do |tweet| |
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
23 May 20:45:42 - Client 7560046834405512 connected | |
connect! | |
registered 7560046834405512 | |
23 May 20:45:43 - xhr-multipart message handler error - TypeError: Object #<Object> has no method 'receiveMessage' | |
at Object.<anonymous> (/home/donp/src/javascript/nowslider/server.js:21:16) | |
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
$ irb | |
irb(main):001:0> RUBY_VERSION | |
=> "1.9.2" | |
irb(main):002:0> 1.8 + 0.1 | |
=> 1.9000000000000001 | |
irb(main):003:0> 1.8 + 0.1 == 1.9 | |
=> false | |
irb(main):004:0> | |
## Ruby 1.8 wont even let you know whats going on! |
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
Cannot modify SafeBuffer in place | |
activesupport (3.0.9) lib/active_support/core_ext/string/output_safety.rb:119:in `rstrip!' | |
kernel/common/string.rb:1495:in `rstrip' | |
activesupport (3.0.9) lib/active_support/core_ext/string/output_safety.rb:115:in `rstrip' | |
string.rb | |
def rstrip | |
str = dup | |
1495: str.rstrip! || str |
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
ruby-1.9.2-p290 :008 > line="Welcome to leguin.freenode.net in Ume\xE5, Sweden, EU!" | |
=> "Welcome to leguin.freenode.net in Ume\xE5, Sweden, EU!" | |
ruby-1.9.2-p290 :011 > line.encoding | |
=> #<Encoding:UTF-8> | |
ruby-1.9.2-p290 :010 > /^$/.match("abc") | |
=> nil | |
ruby-1.9.2-p290 :009 > /^$/.match(line) |
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
Last login: Tue Aug 16 15:00:35 PDT 2011 from 192.168.0.7 on pts/1 | |
Welcome to sirius.donpark.org. Sirius is a dual-core atom d510. | |
| | |
\ _ / | |
-= (_) =- | |
/ \ _\/_ | |
| //o\ _\/_ | |
_ ___ __ _ __ __ _ _ _ _ _ __ __ _ | __/o\\ _ | |
=-=-_=-=-_=-=_=-_=_=-_=-_-_=_=-= _=_=-=_,-'|"'""-|-,_ | |
=- _=-=-_=- _=-= _--_ =-= -_=-=_-=_,-" | |
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/http' | |
res = Net::HTTP.start("twitter.com", 443, {:use_ssl => true}) {|http| | |
http.get("/") | |
} | |
puts res.body[0,100] | |
puts res.inspect |
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/http' | |
require 'net/https' | |
http = Net::HTTP.new('twitter.com',443) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
#specifying the cert location works with ruby1.8 | |
http.ca_file = '/etc/ssl/certs/ca-certificates.crt' | |
res = http.get("/") |
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
$ mount | |
rootfs on / type rootfs (rw) | |
/dev/root on / type ext4 (rw,noatime,user_xattr,acl,barrier=1,data=ordered,discard) | |
devtmpfs on /dev type devtmpfs (rw,relatime,size=1017228k,nr_inodes=254307,mode=755) | |
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) | |
rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755) | |
... | |
$ ls /lib64/rc/init.d/daemons/ | |
nginx/ php-fpm/ sshd/ udev/ |
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
## mongrel config | |
web_app_proxy = Proxy(addr='127.0.0.1', port=1500) | |
routes = { | |
'/': web_app_proxy, | |
} | |
$ sudo tcpflow -c -i lo port 1500 | |
tcpflow[7196]: listening on lo | |
127.000.000.001.55068-127.000.000.001.01500: GET / HTTP/1.1 | |
Host: donpark.org |