save_and_open_page
have_button(locator)
# 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") |
roles = Rails.application.routes.routes.map { |route| route.defaults[:controller] }.select { |i| not i.nil? }.uniq.select { |i| not i.match(/\//) }.reduce({}) { |h,i| h[i] = {index: true, new: false, create: false, edit: false, update: false, destroy: false }; h } |
#!/bin/bash | |
# $1 - HOST | |
echo -n | openssl s_client -connect $1:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/$1.cert |
# Install: https://github.com/rg3/youtube-dl/ | |
# USAGE: | |
# play_youtube https://www.youtube.com/watch?v=4HLaOmiwV5Q&list=PLsVoIP7pW8g984pIJuKXhY9tTG1DiJWY9 | |
function play_youtube(){ | |
mplayer -fs -quiet $(youtube-dl -g -t "$1") | |
} | |
# USAGE: | |
# play_youtube_audio https://www.youtube.com/watch?v=4HLaOmiwV5Q&list=PLsVoIP7pW8g984pIJuKXhY9tTG1DiJWY9 | |
function play_youtube_audio(){ |
I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):
For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.
#!/bin/bash | |
# FIND ALL PDF FILES THAT HAS BEEN ACCESSD BETWEEN SOME DATES AND MOVE TO CURRENT DIR | |
find ~/Documents -name \*.pdf -type f -newermt 2016-04-05 ! -newermt 2016-04-07 -exec mv -t ./ {} \+ |
#!/bin/bash | |
# USAGE | |
# apk-db-pull.sh com.package.example | |
adb backup -f data.ab -noapk $1 | |
dd if=data.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf - |
APP_NAME=MyAppName | |
PACKAGE=com.example.package | |
CC=./gradlew | |
ADB=adb | |
.PHONY: build uninstall install log | |
all: build uninstall install log | |
#!/bin/bash | |
while true; do | |
sleep 20m | |
xmessage -buttons OK:0 -default OK -nearmouse "SESSION IS OVER!!!" -timeout 60 | |
done |