Skip to content

Instantly share code, notes, and snippets.

View taichiman's full-sized avatar

Denis Krivostchokov taichiman

View GitHub Profile
class Admin::MailingSystemsController < AdminController
include ActionView::Helpers::TextHelper
mattr_accessor :jobs_ids do
[]
end
def index
@mailing_system = MailingSystem.new
end
numbers=[]
//seed numbers
var i=1
do {
numbers.push(i)
i++
} while (i<101)
//left only odd
@taichiman
taichiman / gist:a5251824050989c6bec7
Last active November 17, 2015 11:26
cheetsheets
some
@taichiman
taichiman / The Technical Interview Cheat Sheet.md
Last active August 28, 2015 10:08 — 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.
Started GET "/" for 127.0.0.1 at 2015-05-27 17:20:27 +0600
Processing by WelcomeController#index as HTML
Question Load (1.4ms) SELECT "questions".* FROM "questions"
(1.2ms) SELECT COUNT(*) FROM "answers" WHERE "answers"."question_id" = $1 [["question_id", 1]]
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 2]]
(1.2ms) SELECT COUNT(*) FROM "answers" WHERE "answers"."question_id" = $1 [["question_id", 2]]
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 3]]
(1.2ms) SELECT COUNT(*) FROM "answers" WHERE "answers"."question_id" = $1 [["question_id", 3]]
User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 5]]
(1.3ms) SELECT COUNT(*) FROM "answers" WHERE "answers"."question_id" = $1 [["question_id", 4]]
@taichiman
taichiman / new.html.slim
Created April 11, 2015 09:08
test gist 2
= form_for [@question, @answer] do |f|
.form-group
= f.label :body, 'Body'
= f.text_area :body, class: 'form-control'
= submit_tag 'Post Your Answer'
@taichiman
taichiman / new.html.slim
Created April 11, 2015 09:07
test rubymine gist system
- if @answer.errors.any?
/- binding.pry
#error_explanation
h4 #{pluralize(@answer.errors.count, "error")} prohibited this answer from being saved:
ul
- @answer.errors.full_messages.each do |msg|
li = msg
=
=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')
#!/usr/bin/env ruby
ADDED_OR_MODIFIED = /^\s*(A|AM|M)/.freeze
changed_files = `git status --porcelain`.split(/\n/)
changed_files = changed_files.select { |f| f =~ ADDED_OR_MODIFIED }
changed_files = changed_files.map { |f| f.split(" ")[1] }
changed_files = changed_files.select { |file_name| File.extname(file_name) == ".rb" }
changed_files = changed_files.join(" ")
if options[:test]
if options[:parsed_feed]
x= true
else
begin
raise
rescue
puts 'for testing need to pass :parsed_feed key'
end
end