Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar
🏠
Working from home

Bruno Gama brunogama

🏠
Working from home
  • Banco Inter
  • Brazil
  • 16:12 (UTC -03:00)
  • X @brunogama
View GitHub Profile
@brunogama
brunogama / default_browser.sh
Last active December 15, 2015 11:38
This Gist is for all who want to know the User's default browser using the Mac Terminal.
#!/usr/bin/env bash
# Author: Bruno Gama
echo $(basename "$(mdfind "kMDItemCFBundleIdentifier == '$(/usr/bin/plutil -convert xml1 -o - ~/Library/Preferences/com.apple.LaunchServices.plist | grep -B 3 "<string>http</string>" | tail -3 | head -n1 | sed -e 's/<[^>]*>//g' | sed 's/[[:space:]]//g' | tr -d '\040\010\012\015')'cd")" | sed s'/.app$//')
@brunogama
brunogama / omg_themes_fetcher.py
Created December 12, 2013 14:03
omg themes downloader
#!/usr/bin/env python -tt
# -*- encoding: utf-8 -*-
# License: Beerware
from __future__ import print_function
import urllib
import json
AUTHOR = 'Bruno Gama'
TWITTER = '@brunogama'
@brunogama
brunogama / clean_ios_simulator
Created February 9, 2014 13:38
it will clean *ALL* the apps in the iOS Simulator.
#!/usr/bin/env bash
# clean_ios_simulator
# Author: Bruno Gama
pkill -9 -fi simulator 2>/dev/null
_WD="$HOME/Library/Application Support/iPhone Simulator"
find "$_WD" -iname "*.app" | while read l; do
f=$(dirname "$l")
rm -rf "$f"
unset f
@brunogama
brunogama / Delete podcast in overcast.fm
Created October 23, 2014 18:54
because life is too short
$('.episodecell').each(function(index){ window.location = $(this).attr('href').replace('episode', 'delete_item') });
@brunogama
brunogama / gist:479f49f37667c5e1c52d
Created January 30, 2015 16:43
Bulk delete remote git tags
git ls-remote --tags origin | awk '/^(.*)(\s+)(.*[a-z])$/ {print ":" $2}' | xargs git push origin
@brunogama
brunogama / gist:8724d07f0e211a9d0518
Created January 30, 2015 16:45
Bulk delete local git tags
git tag -l | awk '/^(.*[a-z])$/ {print $1}' | xargs git tag -d
@brunogama
brunogama / new-skype
Last active August 29, 2015 14:15
Multiple Skype Instances
#! /usr/bin/env bash
NEXT_SKYPE_PROCESS=$(echo $(( $(ps aux | grep skype | grep -v "grep" | wc -l | tr -d '[[:space:]]') + 1)))
open -na $(mdfind 'kMDItemFSName == "Skype.app"'cd) --args -DataPath /Users/$(whoami)/Library/Application\ Support/Skype${NEXT_SKYPE_PROCESS}
unset NEXT_SKYPE_PROCESS
exit 0
@brunogama
brunogama / tmux-cheatsheet.markdown
Created November 9, 2015 11:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@brunogama
brunogama / resetAllSimulators.sh
Created May 17, 2016 17:13 — forked from ZevEisenberg/resetAllSimulators.sh
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@brunogama
brunogama / String.swift
Created August 11, 2017 18:20
Localized string extension
public extension String
{
public var localized: String {
return NSLocalizedString(self.lowercased(), tableName: nil, bundle: .main, value: "", comment: "")
}
}