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
@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 / readme.md
Created June 14, 2016 14:27 — forked from maxivak/readme.md
Send email to multiple recipients in Rails with ActionMailer

Send email to multiple recipients

Send multiple emails to different recipients.

Mailer class

# app/mailers/notify_mailer.rb

class NotifyMailer < ApplicationMailer
@evaldasg
evaldasg / .profile
Created June 16, 2016 07:42 — forked from sindresorhus/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@evaldasg
evaldasg / Gemfile
Created July 1, 2016 15:50 — forked from petems/Gemfile
An example http download with Progress Bar output in the command line with Ruby and the native `net/http` library...
source "https://rubygems.org"
gem "progressbar"