This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 @ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
camera = new THREE.PerspectiveCamera 75, (window.innerWidth / window.innerHeight), 0.1, 1000 | |
camera = new THREE.PerspectiveCamera( | |
75 | |
window.innerWidth / window.innerHeight | |
0.1 | |
1000 | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp = require 'gulp' | |
pipeline = (streams) -> | |
streams.reduce (former, latter) -> former.pipe latter | |
gulp.task 'default', -> | |
console.log 'from default task' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mail' | |
sender = '' | |
receiver = '' | |
password = '' | |
Mail.defaults do | |
delivery_method :smtp, | |
address: 'smtp.mail.yahoo.com', | |
port: 587, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setxkbmap -layout "us,ru" -option "grp:caps_toggle,compose:ralt" | |
xrandr --output LVDS1 --brightness 0.7 | |
xset b off | |
exec i3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongod --dbpath=/home/user/mongo_experiments/db2 --bind_ip 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts STDIN.readlines.select { |line| line.include? 'Preparation' } |
NewerOlder