Skip to content

Instantly share code, notes, and snippets.

View ck3g's full-sized avatar
👨‍💻
Studying

Vitali Tatarintev ck3g

👨‍💻
Studying
View GitHub Profile
@ck3g
ck3g / proxies.rb
Last active October 20, 2018 15:23
Proxies
PROXIES = %W(
118.97.208.194:3128
118.97.247.107:3128
118.97.211.5:3128
175.136.226.87:3128
200.35.90.38:3128
95.70.208.245:8080
120.203.214.182:83
@ck3g
ck3g / Gemfile
Last active October 12, 2015 05:08
default environment
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
@ck3g
ck3g / autocomplite.css.scss
Last active May 29, 2020 18:02
Twitter bootstrap + rails3-jquery-autocomplete gem styles
ul.ui-autocomplete {
margin-top: 2px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
@ck3g
ck3g / authentication.rb
Created December 12, 2012 09:14
OmniAuth
class Authentication < ActiveRecord::Base
belongs_to :user
attr_accessible :provider, :uid, :user_id
validates :provider, :uid, presence: true
end
@ck3g
ck3g / 1.rb
Last active December 14, 2015 14:18
scope :masseurs_with_name, ->(name) {
includes(:users).where('users.first_name like :name OR users.last_name like :name', name: "%#{name}%" )
}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" RUNNING TESTS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>t :call RunTestFile()<cr>
map <leader>T :call RunNearestTest()<cr>
" map <leader>a :call RunTests('')<cr>
map <leader>c :w\|:!script/features<cr>
map <leader>w :w\|:!script/features --profile wip<cr>
function! RunTestFile(...)
@ck3g
ck3g / ruby.txt
Created May 9, 2013 06:14
Ruby in oh my zsh style
____ __ __ / /_ __ __
/ __// / / // __ \/ / / /
/ / / /_/ // /_/ / /_/ /
/_/ \____//_____/\__, /
/____/
require 'ostruct'
alternatives = [
OpenStruct.new(name: "A1", weight: 1),
OpenStruct.new(name: "A2", weight: 1),
OpenStruct.new(name: "A3", weight: 1),
OpenStruct.new(name: "A4", weight: 1),
OpenStruct.new(name: "B1", weight: 1),
OpenStruct.new(name: "B2", weight: 1),
OpenStruct.new(name: "B3", weight: 1),
@ck3g
ck3g / tdd-playground.swift
Last active March 26, 2018 07:09
TDD in XCode Playground
// Original article: https://m.pardel.net/tdd-in-xcode-playgrounds-544a95db11e2
import XCTest
struct Todo {
}
class TodoTests: XCTestCase {
override func setUp() {
people = [{name: 'Alice'}, {name: 'Bob'}, {name: 'Bill'}, {name: 'Alex'}, {name: 'John'}];
people.reduce((obj, person) => {
const firstLetter = person.name[0].toUpperCase();
return {
...obj,
[firstLetter]: [...(obj[firstLetter] || []), person]
}
}, {});