Skip to content

Instantly share code, notes, and snippets.

Felipe Sabino felipesabino

Block or report user

Report or block felipesabino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felipesabino
felipesabino / UIViewController+ModalCheck.h
Created Jul 25, 2012
Checking whether ViewController is presented as Modal - iOS 5-
View UIViewController+ModalCheck.h
// UIViewController+ModalCheck.h
//
// Created by Felipe Sabino on 06/14/11
#import <UIKit/UIKit.h>
@interface UIViewController (ModalCheck)
-(BOOL)isPresentedAsModal;
@felipesabino
felipesabino / ponydl
Last active Dec 11, 2015
Starts pony debugger without the need to type all "serve --listen-interface" options everythime
View ponydl
#!/bin/sh
if [ -n "$1" ]
then
ponyd serve --listen-interface=$1 & open http://$1:9000
else
ponyd serve --listen-interface=127.0.0.1 & open http://127.0.0.1:9000
fi
View ColorConverter.js
/**
*
* Javascript color conversion
* http://www.webtoolkit.info/javascript-color-conversion.html
*
**/
function HSV(h, s, v) {
if (h <= 0) { h = 0; }
if (s <= 0) { s = 0; }
@felipesabino
felipesabino / migrate.sh
Last active Nov 1, 2017
clone repo from github and mirror it at gitolite
View migrate.sh
# Add repo to gitlite with the same name before executing:
# $ sh migrate.sh MyRepoName
git clone --mirror git@github.com:indigotech/$1.git
cd $1.git
git remote add gitolite gitolite@git.i.ndigo.com.br:$1
git push --all --repo=gitolite
git push --tags --repo=gitolite
cd ..
@felipesabino
felipesabino / dabblet.css
Created May 1, 2013
Circular Tooltip (SO)
View dabblet.css
/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */
@felipesabino
felipesabino / heroku_remove_user.rb
Last active Dec 18, 2015
Dummy CLI to remove an user as colaborator from all your app @ heroku using heroku-toolbelt/2.39.4 (x86_64-darwin10.8.0) ruby/1.9.3
View heroku_remove_user.rb
#!/usr/bin/env ruby
# usage
# $ ruby heroku_remove_user.rb user@email.com
user = ARGV[0]
system "echo removing user #{user}"
str = `heroku apps`
apps = str.split("\n")
apps.delete("=== My Apps")
@felipesabino
felipesabino / setup.sh
Last active Apr 5, 2018
Mac OS small enhancements
View setup.sh
#!/bin/sh
# Sets Terminal to case insensitive
# http://blog.nickburwell.com/blog/2008/11/mac-os-x-terminal-case-insensitive-auto
echo "set completion-ignore-case On" >> ~/.inputrc
# Disables the creation of .DS_Store files on external volumes
# http://danilo.ariadoss.com/how-to-recursively-remove-ds_store-files-on-mac-os-x/
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
# Make Your Keyboard Keys Repeat Properly When Held Down
# http://lifehacker.com/5826055/make-your-keyboard-keys-repeat-properly-when-held-down-in-mac-os-x-lion
@felipesabino
felipesabino / cleanupbranches.rb
Created Jun 25, 2013
Clean up remote branches from github
View cleanupbranches.rb
#!/usr/bin/env ruby
# list branches using
# $ git ls-remote origin | grep refs/heads/
@branches = ['feature-old',
'feature-ignored'
'bugfix-merged']
View .aliases
# original from: https://github.com/addyosmani/dotfiles/blob/master/.aliases
# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
View .gitconfig
[alias]
com = commit -m
ck = checkout
po = push origin
mg = merge --no-ff
st = status -sb
br = ls-remote
lc = ls-files -u
ls = ls -la
a = add -A :/
You can’t perform that action at this time.