Skip to content

Instantly share code, notes, and snippets.

View subratrout's full-sized avatar

Subrat Rout subratrout

View GitHub Profile
@subratrout
subratrout / hci.rb
Created January 5, 2012 20:42 — forked from callumj/hci.rb
Download the Web Applications videos from Stanford's OpenClassroom. http://openclassroom.stanford.edu
require 'uri'
require 'net/http'
require 'fileutils'
BASE = "http://openclassroom.stanford.edu/MainFolder/courses/HCI/videos/"
for l in 1..42 do
for p in 1..20 do
uri = "CS147L" + l.to_s + "P" + p.to_s + ".flv"
@subratrout
subratrout / The Technical Interview Cheat Sheet.md
Created September 30, 2015 14:38 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@subratrout
subratrout / modules.md
Created March 3, 2016 23:19 — forked from JoshCheek/modules.md
Modules (lesson from 29 July 2015) covers object model, namespaces, mixins, and functions.

Modules

To understand modules, we first have to understand a little bit about how Ruby works. So, lets define the things that exist in Ruby and see how they work together. Then, we will be able to understand how modules fit into this, and what they are here for.

Definitions

You can configure an individual repo to use a specific user / email address which overrides the global configuration.
From the root of the repo, run
git config user.name "Your Name Here"
git config user.email [email protected]
whereas the default user / email is configured in your ~/.gitconfig
git config --global user.name "Your Name Here"
git config --global user.email [email protected]
select
a.id as article_id, m.template_id, a.url || a.external_id as url, m.country_code, m.language_code, m.wildcard_exclusion_locales
from obs.ARTICLE a, email.template_dms_map m
where a.id = m.dms_id and m.mapping_on = 1
and regexp_like(m.template_id,'salesorder','i')
-- and a.id in (77068)
order by lower(external_id);
@subratrout
subratrout / gist:e621e75f6e4c3eb0c46c85bf7bdd3ee9
Created May 11, 2017 06:01 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@subratrout
subratrout / mac-apps.md
Created June 22, 2017 21:11 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@subratrout
subratrout / capybara cheat sheet
Created August 3, 2017 23:04 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
Try implementing a method called occurrences that accepts a string argument and uses inject to build a Hash. The keys of this hash should be unique words from that string. The value of those keys should be the number of times this word appears in that string.
def occurrences(str)
word_hash = Hash.new(0)
str.scan(/\w+/).inject(word_hash) do | number, word|
number[word.downcase] += 1
number
end
end
@subratrout
subratrout / btc-eth-dca-buy.php
Created August 24, 2017 22:41 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//