Skip to content

Instantly share code, notes, and snippets.

@qwertme
qwertme / delete_remote_branches.sh
Created May 9, 2018 19:52
Delte remote branches
git fetch --prune | git branch -r --merged | grep origin | grep -v '>' | grep -v master | sed -E "s|^ *origin/||g" | xargs git push origin --delete
require 'google_drive'
while true do
begin
session = GoogleDrive::Session.from_config("config.json")
session.files(q: "trashed = false and (name contains 'unadjustednonraw' or name contains 'facetile' or name contains 'thumb' or name contains 'mini' or name contains 'largepv') and mimeType = 'image/jpeg' and modifiedTime > '2017-08-01T12:00:00'") do |file|
puts file.name
file.delete
end
### Keybase proof
I hereby claim:
* I am qwertme on github.
* I am qwertme (https://keybase.io/qwertme) on keybase.
* I have a public key whose fingerprint is C495 610F E829 B83D B09C CBC7 D98C 56FB CEAD A3EC
To claim this, I am signing this object:
require 'tempfile'
class WriteAndReadRunner
class FileNotFoundError < StandardError; end
def initialize(count = 200)
@all_files = []
@count = count
end
@qwertme
qwertme / gist:931961
Created April 20, 2011 17:06
Bash assertions
ASSERT_COUNTER=0
ASSERT_FAIL_COUNTER=0
assert_equal() {
let ASSERT_COUNTER=ASSERT_COUNTER+1
if [ "$1" != "$2" ]; then
let ASSERT_FAIL_COUNTER=ASSERT_FAIL_COUNTER+1
echo "Expecting '$1' got '$2'"
fi
}