This gist will collect all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
+----------------------+--------+--------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+--------+--------+---------+---------+-----+-------+ | |
| Controllers | 2455 | 1995 | 62 | 259 | 4 | 5 | | |
| Helpers | 135 | 111 | 0 | 18 | 0 | 4 | | |
| Jobs | 131 | 106 | 12 | 11 | 0 | 7 | | |
| Models | 1239 | 952 | 24 | 105 | 4 | 7 | | |
| Mailers | 136 | 110 | 8 | 17 | 2 | 4 | | |
| Channels | 40 | 34 | 4 | 6 | 1 | 3 | | |
| Exceptions | 23 | 22 | 4 | 4 | 1 | 3 | |
This gist will collect all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
-- vim: ts=4 sw=4 noet ai cindent syntax=lua | |
--[[ | |
Conky, a system monitor, based on torsmo | |
Any original torsmo code is licensed under the BSD license | |
All code written since the fork of torsmo is licensed under the GPL | |
Please see COPYING for details |
mkdir ~/vim | |
cd ~/vim | |
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
# Compiled on Jul 20 2017 | |
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz | |
export VIMRUNTIME="$HOME/vim/runtime" | |
export PATH="$HOME/vim:$PATH" | |
cd - |
# Procs are just closures: | |
def my_method_1 | |
counter = 0 # => 0 | |
proc { counter += 1 } # => #<Proc:0x007fadc9244ec8@/Users/durrellchamorro/code/scratch.rb:4> | |
end # => :my_method_1 | |
my_proc = my_method_1 # => #<Proc:0x007fadc9244ec8@/Users/durrellchamorro/code/scratch.rb:4> | |
my_proc.call # => 1 | |
my_proc.call # => 2 |
require 'benchmark' | |
class PerfectNumber | |
def self.classify(number) | |
raise RuntimeError if number <= 1 | |
sum_of_divisors = add_divisors(number) | |
return 'deficient' if sum_of_divisors < number | |
return 'abundant' if sum_of_divisors > number | |
'perfect' |
require 'prime' | |
module PerfectNumber | |
def self.classify(number) | |
raise "Number must be greater than or equal to two" if number < 2 | |
aliquot_sum = generate_aliquot_sum(number) | |
return 'deficient' if aliquot_sum < number | |
return 'abundant' if aliquot_sum > number | |
'perfect' |
class Phrase | |
def initialize(words) | |
@words = words | |
end | |
def word_count | |
count = Hash.new(0) | |
@words.scan(/\b[\w']+\b/) do |word| | |
count[word.downcase] += 1 |
class Crypto | |
def initialize(text) | |
@text = text | |
end | |
def normalize_plaintext | |
@text.gsub(/\W/,'').downcase | |
end | |
def size |
class Anagram | |
def initialize(word) | |
@actual_word = word | |
@sorted_word = sort word | |
end | |
def match(list) | |
selected = list.select { |word| sort(word) == @sorted_word } | |
selected.delete_if { |word| word.downcase == @actual_word } | |
end |