Skip to content

Instantly share code, notes, and snippets.

Subrat Rout subratrout

Block or report user

Report or block subratrout

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@subratrout
subratrout / hci.rb
Created Jan 5, 2012 — forked from callumj/hci.rb
Download the Web Applications videos from Stanford's OpenClassroom. http://openclassroom.stanford.edu
View hci.rb
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 Sep 30, 2015 — 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.
View The Technical Interview Cheat Sheet.md

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 Mar 3, 2016 — forked from JoshCheek/modules.md
Modules (lesson from 29 July 2015) covers object model, namespaces, mixins, and functions.
View modules.md

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

View gist:c2f677b21413b1f6da53ce1a013be0ba
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 your@email.com
whereas the default user / email is configured in your ~/.gitconfig
git config --global user.name "Your Name Here"
git config --global user.email your@email.com
View gist:a3d635fb5d3c3e0af657cd3d5afd1f52
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 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview
View gist:e621e75f6e4c3eb0c46c85bf7bdd3ee9

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 Jun 22, 2017 — forked from erikreagan/mac-apps.md
Mac developer must-haves
View mac-apps.md

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

View 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')
View gist:58848394af50c7db7ccd75a910174a32
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 Aug 24, 2017 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
View btc-eth-dca-buy.php
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
You can’t perform that action at this time.