Skip to content

Instantly share code, notes, and snippets.

View webcoderph's full-sized avatar
:electron:
Available for project

Maynard Cabalitan webcoderph

:electron:
Available for project
View GitHub Profile
@webcoderph
webcoderph / capistrano-setup.txt
Last active January 3, 2021 14:21
Capistrano Setup
#Add to GEMFILE
gem 'capistrano', '~> 3.11'
gem 'capistrano-rails', '~> 1.4'
gem 'capistrano-passenger', '~> 0.2.0'
gem 'capistrano-rbenv', '~> 2.1', '>= 2.1.4'
#Then run
bundle
cap install STAGES=production
class Sugar
def initialize(ingredients)
@ingredient = ingredients
end
def cost
@ingredient.cost + 1
end
end
@webcoderph
webcoderph / memoization.rb
Created April 3, 2018 05:57
Ruby Memoization
def test(input)
@input ||= input
puts "TEST #{@input}"
end
alice = "im alice"
veronica = "im veronica"
thr = []
thr << Thread.new { test(alice) }
@webcoderph
webcoderph / .dockerignore
Created March 23, 2018 09:32 — forked from davidderus/.dockerignore
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@webcoderph
webcoderph / dino_blink101.rb
Last active January 30, 2018 13:12
Using dino gem to connect to your arduino
require 'bundler/setup'
require 'dino'
class Ardui
def initialize
@dependent = {}
end
def board
Dino::Board.new(Dino::TxRx::Serial.new)
@webcoderph
webcoderph / feature.rb
Created December 8, 2017 02:13
Sign In Support Macro With Devise
module Features
def sign_in(user)
visit new_user_session_path
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_on "Log in"
end
end