Skip to content

Instantly share code, notes, and snippets.

View amaxwell-gpsw's full-sized avatar

Andrew Maxwell amaxwell-gpsw

  • GoPro
  • San Francisco, CA
View GitHub Profile
@amaxwell-gpsw
amaxwell-gpsw / viewport-shots.js
Created May 1, 2016 18:31
akes provided URL passed as argument and make full height screenshots of this page * with several viewport widths using Nightwatch.js with Selenium.
/*
* Takes provided URL passed as argument and make full height screenshots of this page
* with several viewport widths using Nightwatch.js with Selenium.
*
* These viewport widths are taken from common android and iOS devices. Modify as needed.
*
* Takes an optional second argument for the path where screenshots are saved.
*
* Usage:
* $ nightwatch -t viewport-shots.js http://example.com
@amaxwell-gpsw
amaxwell-gpsw / delete_branches_older_than.sh
Created February 21, 2016 08:25 — forked from antonio/delete_branches_older_than.sh
Script to delete branches older than a certain date
#!/bin/sh
date=$1
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do
if [[ "$(git log $branch --since $date | wc -l)" -eq 0 ]]; then
if [[ "$branch" =~ "origin/" ]]; then
local_branch_name=$(echo "$branch" | sed 's/^origin\///')
if [[ "$DRY_RUN" -eq 1 ]]; then
echo "git push origin :$local_branch_name"