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
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 / 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 / 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 / keybase.md
Created Feb 8, 2017
Keybase identity proof
View keybase.md

Keybase proof

I hereby claim:

  • I am felipesabino on github.
  • I am felipesabino (https://keybase.io/felipesabino) on keybase.
  • I have a public key ASBk0qjwacKBiWX2X1mmEEeJYkg48UN2SiTzECBiU8Gy8wo

To claim this, I am signing this object:

View swift-problem.swift
//: Playground - noun: a place where people can play
import Foundation
// MARK: Protocols
protocol UserRequestProtocol {
var name: String { get set }
var age: Int { get set }
var password: String { get set }
var likesBacon: Bool { get set }
View gist:585dc0ab64fd34a6488c013f65913ef1
let rx_request = Observable<Value>.create { (observer) -> Disposable in
let requestReference = Alamofire.request(.POST, url, parameters: payload)
.responseJSON(completionHandler: { (response) in
if let value = response.result.value {
observer.onNext(value)
observer.onCompleted()
}else if let error = response.result.error {
observer.onError(error)
}
})
View gist:4624d60884e895ba474dc653979742cc
let rx_request = Observable<Value>.create { (observer) -> Disposable in
let requestReference = Alamofire.request(.POST, url, parameters: payload)
.responseJSON(completionHandler: { (response) in
if let value = response.result.value {
observer.onNext(value)
observer.onCompleted()
}else if let error = response.result.error {
observer.onError(error)
}
})
View gist:61d0390d5c8cab7ecc1923c114719465
let rx_request = Observable<Value>.create { (observer) -> Disposable in
let requestReference = Alamofire.request(.POST, url, parameters: payload)
.responseJSON(completionHandler: { (response) in
if let value = response.result.value {
observer.onNext(value)
observer.onCompleted()
}else if let error = response.result.error {
observer.onError(error)
}
})
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 :/
@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;
You can’t perform that action at this time.