Skip to content

Instantly share code, notes, and snippets.

View katmutua's full-sized avatar
:shipit:

Jackie katmutua

:shipit:
  • X
  • Canada
  • 03:48 (UTC -04:00)
View GitHub Profile
=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')
while read p; do
username=$(cut -f 1 -d "," <<<$p)
pline=$(grep $username accounts/accounts.rb -A1)
password=$(cut -f 4 -d " " <<<$pline)
password=${password:1:${#password}-3}
real_password=$(rake password[$username] | tail -1)
awk -F, "BEGIN { OFS=\",\" } { \$2=\"$real_password\"; print;}" <<<"$p"
done < template_file.csv
@katmutua
katmutua / gist:7e1e249808684f5e2e87
Last active August 29, 2015 14:02
Query YAML File for an object's value
#!/usr/bin/env ruby
require 'yaml'
username = 'some_user'
users = YAML.load_file('users.yaml')
user = users.find { |user| user.username = username}
puts user.username
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
ERROR -: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
man awk
echo 'person,,test,another'
echo 'person,,test,another' | awk -F ,
echo 'person,,test,another' | awk -F, ' { print; } '
echo 'person,,test,another' | awk -F, ' { $2="banana"; print; } '
echo 'person,,test,another' | awk -F, ' { $2="banana"; print; } '
man awk
echo 'person,,test,another' | awk -F, 'BEGIN { OFS="," } { $2="banana"; print; } '
echo 'person,,test,another' | awk -F, 'BEGIN { OFS="," } { $2="banana"; print; }'
echo 'person,,test,another' | awk -F, 'BEGIN { OFS="," } { $2="banana"; print; }'
@katmutua
katmutua / protractor_members.js
Last active August 29, 2015 14:11 — forked from JamieMason/protractor_members.txt
Protractor Methods List
protractor.wrapDriver
protractor.setInstance
protractor.getInstance | //(use browser for versions 0.12 upwards)
protractor.By
element(by.)
protractor.By.binding
element(by.binding(''))
protractor.By.select
element(by.select(''))
@katmutua
katmutua / gist:5bc60e6dc1dfabc1d879
Created December 16, 2014 09:32
Install old versions of libxml2 on OSX Mavericks
cd /usr/local/
git checkout 8939a91 Library/Formula/libxml2.rb
brew install libxml2
ln -s /usr/local/opt/libxml2/bin/xml2-config /usr/local/bin/xml2-config
@katmutua
katmutua / gist:076f20b7280a0a03ee7e
Created December 20, 2014 15:25
Install Nokogiri on OSX Mavericks
brew uninstall nokogiri
brew install libxml2 libxslt libiconv
brew link libxml2 libxslt #may need --force
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri
@katmutua
katmutua / Object inspection
Created May 29, 2015 09:58
Object inspection
Object.__dict__ #python
Object.inspect #ruby
Manually start a server:
-----------------------
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log stop
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log status