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
# This is the deployment recipe | |
# You require to install runit on the server. | |
# First you need to declare on which port the application will run | |
# | |
# echo 3000 > port | |
# | |
# Then you can setup a new runit service with | |
# | |
# make setup_service | |
# |
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 Image | |
attr_accessor :original_image, :image | |
def initialize(image) | |
@original_image = image | |
end | |
def image | |
@image ||= @original_image.dup | |
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 Fixnum | |
def digits | |
to_s.split('').map(&:to_i) | |
end | |
def luhn? | |
luhn_checksum % 10 == 0 | |
end | |
def luhn_checksum |
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 LinkedListNode | |
attr_accessor :value, :next_node | |
def initialize(value, next_node=nil) | |
@value = value | |
@next_node = next_node | |
end | |
end | |
def print_values(list_node) | |
if list_node |
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 Image | |
def initialize(image) | |
@image = image | |
end | |
#Iterate through @image input and identify which indices have a "1". | |
def identify | |
one_index = [] |
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/Gemfile b/Gemfile | |
index dd478e9..0454ddf 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -49,6 +49,7 @@ gem "geocoder" | |
gem "figaro", ">= 1.0.0" | |
gem 'carrierwave' | |
+gem 'rmagick' | |
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 'pp' | |
class Card < Struct.new(:suit, :rank, :color) | |
end | |
class Deck | |
attr_accessor :cards | |
def initialize | |
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
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.production? | |
config.root = Rails.root.join('tmp') | |
config.cache_dir = 'carrierwave' | |
config.storage = :fog | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => ENV['S3_KEY_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
require 'pp' | |
class Image | |
attr_accessor :array | |
def initialize(array) | |
@array = array | |
end | |
def output_image |
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
# This is the deployment recipe | |
# You require to install runit on the server. | |
# Then you can setup a new runit service with | |
# | |
# make setup_service | |
# | |
# Also you need to install the git hooks, so you can push and update this repo | |
# | |
# make setup_git_hook | |
# |
NewerOlder