Skip to content

Instantly share code, notes, and snippets.

View manuelnaranjo's full-sized avatar

Manuel Francisco Naranjo manuelnaranjo

  • Booking.com
  • Amsterdam, Netherlands
View GitHub Profile
#!/usr/bin/env bash
function clean_invalid_refs() {
INVALID_SHAS=`git for-each-ref --format="%(objectname)" | sort | uniq | git cat-file --batch-check | grep missing | cut -d' ' -f 1`;
if [ -z "${INVALID_SHAS}" ]; then
echo "Nothing to cleanup" > /dev/stderr
return
fi
REGEX=$(echo "$INVALID_SHAS" | paste -sd '|')
REFS=`git for-each-ref --format="%(refname) %(objectname)" | grep -E $REGEX | cut -d' ' -f 1`
@manuelnaranjo
manuelnaranjo / main.py
Last active March 27, 2017 15:39
Remove all cloudwatch streams
# this script will clear up and remove all registered cloudwatch log streams
# there's no filter so use it with caution
import boto3
client = boto3.client('logs')
while True:
response = client.describe_log_groups()
if not response or 'logGroups' not in response:
@manuelnaranjo
manuelnaranjo / gcc-arm-embedded-4.9.rb
Last active January 5, 2017 19:47
gcc-arm-none-eabi-4_9-2015q1-20150306 for brew
# based on https://github.com/spark/firmware/issues/1077#issuecomment-263025005
require 'formula'
class GccArmEmbedded49 < Formula
homepage 'https://launchpad.net/gcc-arm-embdded'
version '20150306'
url 'https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q2-update/+download/gcc-arm-none-eabi-4_9-2015q2-20150609-mac.tar.bz2'
sha256 '48841185eefa482f0338059dd779b3edf832521ccd05811d557ef4a2807b8284'