system("printf \"\033]0;Rails\007\"")
This file contains 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
type T struct { | |
A int | |
B string | |
} | |
t := T{23, "skidoo"} | |
s := reflect.ValueOf(&t).Elem() | |
typeOfT := s.Type() | |
for i := 0; i < s.NumField(); i++ { |
This file contains 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 'bcrypt' | |
char71 = "a" * 71 | |
char72 = char71 + "b" | |
BCrypt::Password.create(char71) == char72 # => false | |
char72 = "a" * 72 | |
char73 = char72 + "b" |
This file contains 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
?attempt=&filename=nope |
This file contains 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' | |
require 'uri' | |
url = URI.parse("https://github.com/") # OK | |
#url = URI.parse("https://etutorials.org/") # Hostname mismatch | |
http = Net::HTTP.new(url.host, url.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
request = Net::HTTP::Get.new(url.path) |
This file contains 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' | |
require 'openssl' | |
url = URI.parse("https://github.com/") # OK | |
#url = URI.parse("https://etutorials.org/") # Hostname mismatch | |
http = Net::HTTP.new(url.host, url.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER |
Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.
- All jquery plugins should be prefixed with jquery, such as
jquery.facebox
- All github-specific jquery plugins should be prefixed with jquery.github. Like
jquery.github.repo_list.js
- All page-specific files (that only run on ONE page) should be prefixed with page.
page.billing.js
This explanation seems to be lost in the current README
You’re asking: "why would I want multiple sessions?". Take this example:
You have an app where users login and then need to re-login to view / change their billing information. Similar to how Apple’s me.com works. What you could do is have the user login with their normal session, then have an entirely new session that represents their "secure" session. But wait, this is 2 users sessions. No problem:
# regular user session
@user_session = UserSession.new
@user_session.id
This file contains 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
XML Document parsing benchmark | |
user system total real | |
hpricot:xml:doc 10.160000 0.950000 11.110000 ( 11.144462) | |
hpricot2:xml:doc 0.950000 0.000000 0.950000 ( 0.953266) | |
nokogiri:compat:doc 0.220000 0.020000 0.240000 ( 0.238401) | |
nokogiri:xml:doc 0.170000 0.030000 0.200000 ( 0.200283) | |
XML XPath benchmarks (//status/text, //user/name) | |
user system total real | |
hpricot:xml:xpath 7.580000 1.150000 8.730000 ( 8.728314) |
NewerOlder