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 'httparty' | |
class KuCoin | |
def self.get_symbols_list(opts = {}) | |
url = "https://api.kucoin.com/api/v1/symbols" | |
HTTParty.send(:get, url, opts).yield_self do |response| | |
response | |
end | |
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
require 'set' | |
require 'csv' | |
require 'amazing_print' | |
filename = "skus.csv" | |
s1 = Set.new | |
old_skus = [] | |
old_skus_dupes = [] |
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
# Attribute readers, writers, and accessors for POROs (Plain Old Ruby Objects) | |
# no ActiveRecord | |
# no Rails | |
class Animal; end | |
Animal.new.speak # NoMethodError (undefined method `speak' for #<Animal:0x00007fb19c940840>) | |
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
{ | |
"basics": { | |
"name": "Benjamin Poon", | |
"label": "Software Developer", | |
"picture": "https://avatars.githubusercontent.com/u/2030072?v=4", | |
"email": "benjamintpoon@gmail.com", | |
"phone": "(832) 275-1259", | |
"website": "", | |
"summary": "Software Developer with experience spanning the full stack: front end, back end, test, dev ops/infrastructure. I am always excited to explore different technologies in order to deliver applications that solve business problems.\n\nI love to steer a project through its full life cycle, transforming an initial idea into reality. While I rely on good documentation and best practices, I also value \"thinking outside of the box\" - I enjoy exploring clever and unorthodox ways to achieve our business goals.\n\nSome technologies I love: Ruby on Rails, Elixir, PostgreSQL, Linux, Docker, Javascript, Redis, AWS, ReactJS, and many more.\n\nWhen I’m not getting paid to code, I'm outdoors. I love playing soccer, fishing, and hiking with my wife and three dogs.", | |
"lo |
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
function weightShamer (gender, weight) { | |
var idealWeight = (gender == "male" ? 165 : 140); | |
if (weight == idealWeight) { | |
message = "good"; | |
} else if (weight < idealWeight) { | |
message = "under weight"; | |
} else { | |
message = "over weight"; | |
} |
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
# see the current log output on production with: | |
# dmesg | grep bundle | |
[1280275.496381] Memory cgroup out of memory: Kill process 20821 (bundle) score 178 or sacrifice child | |
[1280275.496416] Killed process 20821 (bundle) total-vm:1184088kB, anon-rss:547236kB, file-rss:11564kB, shmem-rss:0kB | |
[1280275.673954] oom_reaper: reaped process 20821 (bundle), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB | |
[1283252.998599] [30469] 0 30469 145952 52490 192 4 0 0 bundle | |
[1283252.998611] [30758] 0 30758 297303 110655 334 5 0 0 bundle | |
[1283252.998621] [30768] 0 30768 314715 122308 347 5 0 0 bundle |
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
var fruits = ['apple', 'banana', 'tomato?', 'strawberry', 'peach']; | |
Given the above fruits array, return... | |
1. The first fruit element | |
2. The last fruit, without mutating the fruits array | |
3. The last fruit, removing it from the fruits array. |
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
var choices = ['rock', 'paper', 'scissors']; | |
var userChoice = prompt("Do you choose rock, paper, or scissors?"); | |
var randNum = Math.floor(Math.random() * choices.length)); | |
var computerChoice = choices[randNum]; |
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
var nameString = function(name) { | |
return "Hi, I am" + " " + name; | |
}; | |
nameString("david"); <~~~ Call nameString() by passing it your name, and use console.log to print the output. | |
nameString(console.log("david")); <~~ Show result as "Hi, I am undefined" | |
Not quite sure as how to do that. As I tried this and I know that this is incorrect. | |
nameString("david") | |
^ |
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
$(function(){ | |
var oldGuardians = [ | |
{ | |
name: "Star Lord", | |
notes: "Team leader" | |
}, | |
{ | |
name: "Drax the Destroyer" | |
}, |
NewerOlder