If you're just starting with Rails, I will suggest you to learn Ruby first. If you know how its object model, inheritance and mixins work, you're good to start creating web application with it. This is very important. A lot of people dive into Rails without learning basic Ruby first (that's how I did) and get frustrated because they don't understand how it works. I will highly recommend The Well Grounded Rubyist by David Black to start learning Ruby. You can also get a good introduction of Ruby by working your way through interactive tutorials on Codeacademy. You don't need to understand metaprogramming in the beginning. But if you decide to do so, I will suggest book Metaprogramming Ruby by Paolo Perrotta. It's best in covering the subject matter. It's a little bit old though but still good nonetheless. Also see third point in [comment](https://gist.github.com/waseem/5068050/#
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
query { | |
repository(owner: "rails", name:"rails") { | |
ref(qualifiedName:"master") { | |
target { | |
... on Commit { | |
id | |
# | |
# We're are requesting commits in the multiple of 5. We can assume that the page size here is 5. | |
# Next page/cursor should use value in next multiples of 5s. So next page will have a | |
# after: "05eaa07627376626902bd7acde35406edf1bb2f2 5" |
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
for v in range(height): | |
for u in range(width): | |
# Get end of ray and round to sdf array coordinate... | |
pos = start[v,u,:] + travel[v,u] * norm[v,u,:] | |
pos += 0.5 * numpy.array(sdf.shape) # Center of sdf to 3D origin | |
sdf_coordinate = (pos+0.5).astype(int) | |
# Loop the 3 dimensions and check each is not out of bounds... | |
for d in range(3): | |
if sdf_coordinate[d]<0: |
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
{ | |
"Message-Id"=>"<20130503182626.18666.16540@barcelonites.com>", | |
"X-Mailgun-Sid"=>"WyIwNzI5MCIsICJhbGljZUBleGFtcGxlLmNvbSIsICI2Il0=", | |
"attachment-count"=>"1", | |
"body-plain"=>"", | |
"code"=>"550", | |
"domain"=>"barcelonites.com", | |
"error"=>"5.1.1 The email account that you tried to reach does not exist. Please try\n5.1.1 double-checking the recipient's email address for typos or\n5.1.1 unnecessary spaces. Learn more at\n5.1.1 http://support.example.com/mail/bin/answer.py", | |
"event"=>"bounced", | |
"message-headers"=>"[[\"Received\", \"by luna.mailgun.net with SMTP mgrt 8734663311733; Fri, 03 May 2013 18:26:27 +0000\"], [\"Content-Type\", [\"multipart/alternative\", {\"boundary\": \"eb663d73ae0a4d6c9153cc0aec8b7520\"}]], [\"Mime-Version\", \"1.0\"], [\"Subject\", \"Test bounces webhook\"], [\"From\", \"Bob <bob@barcelonites.com>\"], [\"To\", \"Alice <alice@example.com>\"], [\"Message-Id\", \"<20130503182626.18666.16540@barcelonites.com>\"], [\"List-Unsubscribe\", \"<mailto:u+na6tmy3ege4tgnldmyytqojqmfsdemb |
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
## | |
# A Rake interface to creating a tunnel using ssh. | |
# This file originally comes with the facebooker gem for Ruby on Rails: http://github.com/mmangino/facebooker | |
# | |
# How to use: | |
# 1. Simply put it at a proper place. e.g. lib/tasks/ in your Rails application | |
# 2. Create a config file 'easy_tunnel.yml' like following: | |
# | |
# development: | |
# public_host_username: host_user_name |
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
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb | |
index 8c04cb5..132d803 100644 | |
--- a/ext/openssl/extconf.rb | |
+++ b/ext/openssl/extconf.rb | |
@@ -104,6 +104,9 @@ | |
have_func("SSLv2_method") | |
have_func("SSLv2_server_method") | |
have_func("SSLv2_client_method") | |
+have_func("SSLv3_method") | |
+have_func("SSLv3_server_method") |
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
$ irb | |
2.0.0p0 :001 > s1 = "some thing" | |
=> "some thing" | |
2.0.0p0 :002 > s2 = s1 | |
=> "some thing" | |
2.0.0p0 :003 > s2 | |
=> "some thing" | |
2.0.0p0 :004 > s1 = "some other thing" | |
=> "some other thing" | |
2.0.0p0 :005 > s2 |
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
class CreateVideos < ActiveRecord::Migration | |
def change | |
create_table :videos do |t| | |
t.string :video | |
t.text :meta_info | |
t.timestamps | |
end | |
end | |
end |
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
class Company | |
attr_reader :title | |
def initialize(title) | |
@title = title.capitalize | |
@users = [] | |
end | |
def add_company_name(new_comp) | |
@title = new_comp |
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
1. An issue popups in Github. A bug or a feature request. | |
2. Developer starts coding after understanding the issue. He makes sure to add issue number in the form of #XXX - XXX is issue number - to the commit message. This links issue with the commit that was made. It's important to know 'why the commit was made'. | |
3. A CI listens to pushes to the Github repo and runs all the specs and optionally deploys the code to one of the staging servers. | |
4. After developer is done with coding, s/he assigns the issue to another developer for code review. | |
5. Code reviewer makes sure that all the tests are passing along with presence of code and test coverage. Code reviewer can assign issue back to the developer if there is some issue with the code. Developer will start at step 1 again. | |
6. Code reviewer assigns issue to QA. If QA is not happy, s/he adds issues that were found as comment to the original issue or possibly create new issues depending upon severity of the problem s/he found out. | |
7. If QA is happy, she assigns th |
NewerOlder