Skip to content

Instantly share code, notes, and snippets.

View ch1c0t's full-sized avatar

Anatoly Chernov ch1c0t

View GitHub Profile
# Returns a new Array containing only those elements that occur
# twice or more times in the original Array.
Array::recurrences = ->
FirstOccurrences = [] # of the recurring elements
# in the original Array
occurrences = {} # from an element to an Array of indexes
# where it occurs
for element, index in @
camera = new THREE.PerspectiveCamera 75, (window.innerWidth / window.innerHeight), 0.1, 1000
camera = new THREE.PerspectiveCamera(
75
window.innerWidth / window.innerHeight
0.1
1000
)
gulp = require 'gulp'
pipeline = (streams) ->
streams.reduce (former, latter) -> former.pipe latter
gulp.task 'default', ->
console.log 'from default task'
if defined? PryByebug
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
begin
require 'awesome_print'
AwesomePrint.defaults = { raw: true }
require 'mail'
sender = ''
receiver = ''
password = ''
Mail.defaults do
delivery_method :smtp,
address: 'smtp.mail.yahoo.com',
port: 587,
require 'watir'
class LoginPage
def initialize browser, url = 'https://www.linkedin.com/uas/login'
@browser, @url = browser, url
end
def sign_in_with login, password
@browser.goto @url
@browser.input(id: 'session_key-login').send_keys login
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
setxkbmap -layout "us,ru" -option "grp:caps_toggle,compose:ralt"
xrandr --output LVDS1 --brightness 0.7
xset b off
exec i3
@ch1c0t
ch1c0t / local_mongo
Created October 19, 2017 20:50
local_mongo
mongod --dbpath=/home/user/mongo_experiments/db2 --bind_ip 127.0.0.1
puts STDIN.readlines.select { |line| line.include? 'Preparation' }