Instantly share code, notes, and snippets.

# dinhhuydh

• Sort options
Created Nov 30, 2017
Ruby loop exercises
View Ruby loop exercises
 # 1. Returns the elements at even positions # a = [5,6,7,3] # => [5,7] (5 at index 0, 7 at index 2) # 2. Calculate the fibonaci at n th (1,1,2,3) # fibonaci(2) => 1 # fibonaci(4) => 3 # 3. Count how many number 4 in array
Created Dec 3, 2017
View ruby_exercise_2.rb
 #1. sum of even numbers # count_even(a) # [1,2,3] => 2 # [1,2,4] => 6 # 2. Return names with 'H' at first letter # ['Haa', 'aa', 'kkk] => ['Haa']
Created Dec 9, 2017
View ruby_exercise_3.rb
 # 1. count number of words in a string # E.g 1: count_words("this is an object") ==> 4 # 2. Count how many max numbers # eg1: [3,5,6,3,6] => 2 # eg2: [1,5,6,6,6] => 3 # 3. Find longest string # eg 1: ['a', 'bbbbb', 'zzz'] => 'bbbb'
Created Dec 11, 2017
View ruby_exercise_4.rb
 # 1 Print square of number from 1 to n # eg1: squares(3) => [1, 4, 9] # 2: Print all numbers with 3 digits have two '1' digits like 112, 131 # 3. Calculate sum of digits in the numbers # eg1: [12, 4, 154] => [3, 4, 10] # 4. Transform a number to simple word of digits # eg1: 12 => one two
Last active Dec 30, 2017
View Kengkeng_guideline.md

## Principle

• It does not predict a price up or down
• It only notify when there is a rise on a coin. Price change is > 1.5% and volume change > 2%
• It gets data on Poloniex page
• The bot fetch data every 3 minutes

## Examples

Ripple 1.0559% rises vs previous price. Volume: 22.6 btc. 24h Volume: 61960.10461694 btc. Rise streak: 1. Rise percentage (recent 100): 50.5%. Trend: 1.05% -0.73% -0.83% -0.13% -1.88% -1.23% 1.25% 0.63% -1.76% -1.5% . Watch & buy?

• Rise 1.0559% to previous price in btc
• Volume: 22.6 btc (estimated, maybe incorrect because Poloniex does not supply)
• 24h Volume
Last active Aug 26, 2018
View overcommit_debugger.rb
 # added to .git-hooks/pre_commit/debugger.rb module Overcommit::Hook::PreCommit # Check for Debugger class Debugger < Base def run keywords = config['keywords'] result = execute(command, args: [keywords.join('|')] + applicable_files) unless result.stdout.empty? extract_messages(
Created Sep 13, 2018
View custom_rubocop.rb
 ## require in .rubocop.yml require - ./linters/migration/add_index_name.rb ## config in .hound.yml ruby: config_file: .rubocop.yml
Created Sep 13, 2018