Skip to content

Instantly share code, notes, and snippets.

View g-ilham's full-sized avatar

g-Ilham g-ilham

  • Russian, Republic of Tatarstan, Kazan
View GitHub Profile
class FlatArray
  attr_reader :nested_array, :flatten_array

  def initialize(nested_array = [])
    @nested_array = nested_array
    @flatten_array = []
  end

 def call
@g-ilham
g-ilham / gist:6b5d1ef8fbf5119e541bd2fc3c781529
Created January 23, 2017 19:42 — 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.

@g-ilham
g-ilham / gitconfig.md
Created November 22, 2016 16:22
My gitconfig
[user]
	name = g-ilham
	email = ilgamgaysin@gmail.com
  helper = osxkeychain

[color]
  branch = auto
  diff = auto
  pager = true
@g-ilham
g-ilham / quick_start_rails_apps.md
Last active November 18, 2016 09:04
Quick start rails apps

rails new name_of_project -d postgresql -J --skip-turbolinks --no-skip-javascript -T -B -C

-d - is for defenition of database

-J --skip-turbolinks - is for skip turbolinks

-T - is for skip creation a /test folder

-B - is for skipping running bundle after create folders

@g-ilham
g-ilham / install_chrome_driver.md
Created August 18, 2016 12:47
Working instalation of chromedriver from google store

#Instruction by instalation through Google Storage

sudo apt-get install unzip

wget -N http://chromedriver.storage.googleapis.com/<your_version>/chromedriver_linux<your_bit>.zip
unzip chromedriver_linux<your_bit>.zip
chmod +x chromedriver

sudo mv -f chromedriver /usr/local/share/chromedriver
@g-ilham
g-ilham / postgres in another pid.md
Created March 17, 2016 08:05
check running postgres in another pid

OSX Mavericks has been crashing randomly recent to me. Just very random. Not quite good because it doesn't give it the chance for processes like Postgres, etc... to shut down properly, leaving process ids (PIDs) behind.

Now got this issue where my postgres won't boot up.

Running postgres manually doesn't work

> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
> pg_ctl: another server might be running; trying to start server anyway
So here's a quick fix.
@g-ilham
g-ilham / postgres_cheatsheet.md
Last active December 14, 2015 09:52
postgres cheatsheet

log in on psql console: sudo -u postgres psql postgres

\q- quit ini console

\l - databases

\c mydb - use this db

\dt - tables

@g-ilham
g-ilham / gist:5dacd9ec3c003854b6b3
Created November 4, 2015 08:52 — forked from rusllonrails/gist:b51f0fc9c82a718c12fd
MAKE A PICTURE FOR DIV
http://jsfiddle.net/6FZkk/1/
http://stackoverflow.com/questions/6887183/how-to-take-screen-shot-of-a-div-with-javascript
http://html2canvas.hertzen.com/examples.html
OTHER
http://stackoverflow.com/questions/16894683/how-to-print-html-content-on-click-of-a-button-but-not-the-page
http://stackoverflow.com/questions/2255291/print-the-contents-of-a-div
http://stackoverflow.com/questions/468881/print-div-id-printarea-div-only
http://sarwarhossain.com/2010/10/05/print-a-div-open-new-window-print-and-close-using-javascirpt/
http://webfont.ru/font/adine - "DASCASC" выпирающий шрифт, я его использую в проекте
http://webfont.ru/font/champignon - "blyad work" - выпирающий шрифт
http://webfont.ru/font/classica-one - "adsadff" - выпирающий шрифт
http://webfont.ru/font/christmas-script - "adsffffF" - выпирающий шрифт
сервис для футболок:
http://www.customink.com/lab#loc-singles
http://www.spreadshirt.ca/custom-t-shirts-C8579/lpDesigner
- https://learn.javascript.ru/font-size-line-height - пояснение на русском об этом
@g-ilham
g-ilham / benchmark.markdown
Last active September 25, 2015 17:06
benchmark

require 'benchmark'

cube = Cube.find(93)

Benchmark.bmbm do |x|
  x.report("all_cube_images") { Image.all_cube_images(1, 93) }
  x.report("cube.images")  { cube.images  }
end.each do |el|