Skip to content

Instantly share code, notes, and snippets.

View subratrout's full-sized avatar

Subrat Rout subratrout

View GitHub Profile
@subratrout
subratrout / questions.md
Created September 22, 2017 23:30 — forked from Vasyl-Varkholyak/questions.md
Questions to Ask During a Ruby Interview

Begin!

Senior programmers won't have a problem with these, while junior programmers will usually give only half-answers.

What is a class?

A text-book answer: classes are a blue-print for constructing computer models for real or virtual objects... boring.

In reality: classes hold data, have methods that interact with that data, and are used to instantiate objects.

@subratrout
subratrout / Interview_questions.md
Created September 22, 2017 23:30
Ruby, Rails and Sql Specific Questions

Rails

  1. Fix the following snippet. Given a collection of 1000 draft Articles, update all of them to be published

    Post.where(status: :draft).each { |p| p.update_attributes(status: :published}
    #Ans. Post.where(status: :draft).update_all(status: :published)

WDI 34 Learning Objectives

Developers will be able to...

Week 1

###Command Line

  • Navigate the file system from the command line.
  • Create, move, copy, and delete files or directories from the command line.
@subratrout
subratrout / parse_interviews.rb
Created September 24, 2017 01:37 — forked from vlandham/parse_interviews.rb
parse usesthis.com
#!/usr/bin/env ruby
require 'yaml'
require 'json'
input_dirname = ARGV[0]
output_filename = "parsed_interviews.json"
class Categorizer
HW_CATEGORIES = [[/.*dell.*/, ["pc","system"]],
@subratrout
subratrout / goals.md
Created September 24, 2017 01:38 — forked from julsfelic/goals.md
Goals

Goals

Here are my goals that I would like to accomplish over the next year.

Goal #1 - Become proficient in JavaScript and its ecosystem

  • Currently, I have a decent grasp over the language. There are still some ES5 methods I am not familiar with and ES6 is hit or miss with what I know. The JS ecosystem is still something I'm getting used to (npm) and using a tool like webpack is still tough to wrap my head about.
  • Success would be fully understanding all the little quirks of JS and keeping up with the latest version of the language. Being able to structure modern client side applications using webpack and taking advantage of npm. Also, I would like to become fairly proficient with building out API's with Node.
  • Resources for learning:
  • YDKJS

Array<T>

Legend:

  • ✏️ method changes this.
  • 🔒 method does not change this.

Array<T>.prototype.*:

  • concat(...items: Array: T[] 🔒 ES3
@subratrout
subratrout / array_iteration_thoughts.md
Created April 3, 2018 06:16 — forked from mrmartineau/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and