This file contains hidden or 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 hidden or 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
| 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 |
This file contains hidden or 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
| #!/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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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; }' |
This file contains hidden or 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
| 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('')) |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| brew uninstall nokogiri | |
| brew install libxml2 libxslt libiconv | |
| brew link libxml2 libxslt #may need --force | |
| NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri |
This file contains hidden or 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
| Object.__dict__ #python | |
| Object.inspect #ruby |
This file contains hidden or 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
| 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 | |
OlderNewer