Skip to content

Instantly share code, notes, and snippets.

View ootoovak's full-sized avatar

Juna Ootoovak ootoovak

View GitHub Profile
require 'pry'
require 'pry-byebug'
def get_even_numbers_from_zero_to(number)
numbers = []
(0..9).each do |number|
numbers << number if (number % 2 == 0)
end
@ootoovak
ootoovak / useful_ruby_methods.md
Last active July 23, 2021 05:56
Ruby Array, Hash, and Enumerable to start with

Ruby Array, Hash, and Enumerable methods

What is this?

This is a list of methods from Ruby's Array, Hash, and Enumerable that I find useful and have used a lot. It is by no means an complete list so just think of it as a starting point. (BTW, Enumerable is a mixin and not a class but both Array and Hash include it they both have Enumerable methods avaliable to them.)

In preperation for this week and the upcoming week make sure you are understand how to sort and filter each of these data structures. Read the documentation on these methods and play with them in IRB.

@ootoovak
ootoovak / _gitignore_rails.sh
Last active August 29, 2015 14:15
Starter Git Ignore files (rename to .gitignore and add to the root of your project directory).
.DS_Store
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/tmp/
/test/version_tmp/
@ootoovak
ootoovak / introrx.md
Last active September 16, 2015 00:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@ootoovak
ootoovak / 0_reuse_code.js
Created May 21, 2017 22:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Verifying that "ootoovak.id" is my Blockstack ID. https://onename.com/ootoovak