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
=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') |
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
#NoEnv | |
#Include %A_ScriptDir% | |
#Include VA.ahk | |
#SingleInstance force | |
SetTimer,UPDATEDSCRIPT,1000 | |
OnExit, EXITSCRIPT | |
HomePath = C:\Users\ThalesErnesto | |
; Media control |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
def histogram(data, bins = 10, length = 100) | |
min, max = data.minmax | |
mod = max - min | |
histog = data.group_by { |v| ((v - min).to_f / mod * bins).to_i }.map { |bin, values| [bin, values.count] }.to_h | |
max_value = histog.map { |_, value| value }.max | |
histog_array = [0] * bins | |
histog = histog.each { |bin, value| histog_array[bin] = (value.to_f / max_value * length).to_i } | |
puts histog_array.to_s | |
puts min.to_s + " " * length + max_value.to_s | |
histog_array.each { |value| puts "*" * value.to_i } |
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
function difference(old_one, new_one){ | |
var difference = []; | |
new_one.forEach(function(new_el){ | |
var common = false; | |
old_one.forEach(function(old_el){ | |
if(old_el[0] === new_el[0]){ | |
common = true; | |
} | |
}); | |
if(!common){ |
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
convert = (function () { | |
return { | |
toString: toString, | |
toNumber: toNumber, | |
toArray: toArray, | |
} | |
function toString(value) { | |
if (typeof value === 'undefined' || value === null) return ''; | |
return String(value); |
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
" Settings | |
set nosmoothscroll | |
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
let searchlimit = 30 | |
let scrollstep = 70 | |
let barposition = "top" | |
" alias ':g' to ':tabnew google' | |
command g tabnew google |
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
var app = Application.currentApplication() | |
app.strictParameterType = true | |
var sitesBlacklist = [ | |
/reddit.com$/, | |
/youtube.com$/, | |
] | |
var appsBlacklist = [ | |
"Slack", | |
"WhatsApp", |