gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
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 'uri' | |
require 'json' | |
require 'rspec/autorun' | |
class GithubScore | |
SCORING_PARAMS = { | |
"IssuesEvent" => 1, | |
"IssueCommentEvent" => 2, | |
"PushEvent" => 3, |
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 developer path | |
---------------------- | |
* General: | |
1- Starting rails general knowledge with Odin: https://www.theodinproject.com/tracks/1 | |
2- Reddit Rails community: https://www.reddit.com/r/rails/ | |
3- Slack Rails community: https://www.rubyonrails.link/ | |
4- Ruby Inside for the latest ruby/rails news and top notch articles: http://www.rubyinside.com/ | |
5- Get feedback on your code and how to refactor through Code exchange: https://codereview.stackexchange.com/ | |
6- Ruby Weekly: https://rubyweekly.com/ |
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
1) Check for any syntax errors in your ruby file and print them: | |
ruby -wc example.rb | |
-c : Check Syntax | |
-w : Enable warnings | |
--------------- | |
2) Print Ruby version: |
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
Books: | |
Tech: | |
The well grounded Rubyist | |
Eloquent Javascript | |
HTML And CSS - Design and build Websites | |
Cracking the coding interview | |
Programming Interviews Exposed | |
Clean Code | |
The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition | |
Don't make me think - Revisited |
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 String | |
Caesar_lower_case_letters = ('a'..'z').to_a | |
Caesar_upper_case_letters = ('A'..'Z').to_a | |
def caesar_shift(n) | |
letters = [Caesar_lower_case_letters, Caesar_upper_case_letters].find{|t| t.index(self) } | |
return self.dup unless letters | |
new_index = (letters.index(self) + n) % letters.length | |
letters[new_index] | |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
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
def dirReduc(arr) | |
check = {north: "SOUTH", south: "NORTH", east: "WEST", west: "EAST"} | |
res = [] | |
for i in 0...arr.length | |
if res.last && check[res.last.downcase.to_sym] == arr[i] | |
res.pop | |
else | |
res << arr[i] | |
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
class Node | |
attr_accessor :data, :next | |
def initialize(data) | |
@data = data | |
@next = nil | |
end | |
end | |
def length(node) | |
return 0 unless node |
NewerOlder