Skip to content

Instantly share code, notes, and snippets.

=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')
class Bob
def reply_to(statement)
public_send("reply_to_#{statement.class}".downcase.to_sym)
rescue NoMethodError
default_reply
end
def reply_to_silence
"Fine. Be that way!"
end
@evaldasg
evaldasg / Stopcallinghome.txt
Last active August 29, 2015 14:27 — forked from CHEF-KOCH/Stopcallinghome.txt
Windows 10 seems to be an privacy nightmare, here is how you can stop the home calling function
Microsoft's Windows 10 has permission to spy on you
Well first of all "spying" is a bit misleading, it's written down in the eula/terms what can be collected, the major problem is that
this will be collected even on the first installation without getting any chance to change that.
Available Tools:
Destroy Windows 10 Spying
DoNotSpy10
# protocol version mismatch -- is your shell clean?
# (see the rsync man page for an explanation)
# rsync error: protocol incompatibility (code 2) at compat.c(176) [Receiver=3.1.1]
# ^ this was caused because of bashrc configuration which had some output, we can prevent this with:
# add this at the top of bashrc file on your end-point
# this will do nothing if runnig not interactively
case $- in
*i*) ;;
*) return;;
esac
@evaldasg
evaldasg / deploy.rb
Created February 4, 2016 12:24 — forked from cannikin/deploy.rb
Notify Sentry of a new release via Capistrano
# This task will notify Sentry via their API[1] that you have deployed
# a new release. It uses the release timestamp as the `version`
# (like 20151113182847) and the git ref as the optional `ref` value.
#
# This task requires several environment variables be set (or just
# hardcode the values in here if you like living on the edge):
#
# ENV['SENTRY_API_ENDPOINT'] : API endpoint, https://app.getsentry.com
# ENV['SENTRY_ORG'] : the organization for this app
# ENV['SENTRY_PROJECT'] : the project for this app
@evaldasg
evaldasg / gist:a7cd77af990d8f905e7e
Created February 5, 2016 06:07 — forked from ebuildy/gist:5d4ad0998848eaefdad8
Setup sentry logger on a fresh Ubuntu server
sudo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install redis-server
sudo -u postgres createuser -s sentry
sudo -u postgres psql -c "alter user sentry with password 'sentry';"
class Hash
def using(&block)
values = block.parameters.map do |(type, name)|
self[name]
end
block.call(*values)
end
end
@evaldasg
evaldasg / # vim - 2016-04-06_10-37-20.txt
Created April 6, 2016 07:52 — forked from anonymous/# vim - 2016-04-06_10-37-20.txt
vim on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for vim on Mac OS X 10.11.4
Build date: 2016-04-06 10:37:20
@evaldasg
evaldasg / gb_by_date.sh
Created April 22, 2016 05:55
Show git branches by date
for k in `git branch|sed s/^..//`;do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k";done|sort
@evaldasg
evaldasg / removeProperty.js
Created May 20, 2016 11:59
Immutable state; remove property based on key which is passed;
var state = {
0: "zero",
1: "one",
2: "two",
x: "hello"
};
function removeByKey (myObj, deleteKey) {
return Object.keys(myObj)
.filter(key => key !== deleteKey)