Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am rafaelsachetto on github.
* I am rafaelsachetto (https://keybase.io/rafaelsachetto) on keybase.
* I have a public key ASDKnsNT-4jE4r6JupYZqLoKxeuYsgSa6AnAqFMkRlPznQo
To claim this, I am signing this object:
@rafaelsachetto
rafaelsachetto / UIImageView+Extentions.swift
Last active September 18, 2019 20:20 — forked from kakopappa/swift
Show UIActivityIndicatorView inside UIImageView
//
// UIImageView+Extentions.swift
// MealSpecials
//
// Created by Aruna on 8/9/15.
// Copyright (c) 2015 com.mealspecials. All rights reserved.
//
import UIKit
import ObjectiveC
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
@rafaelsachetto
rafaelsachetto / .zshrc
Last active July 29, 2018 22:57
oh-my-zsh linux configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bira"
@rafaelsachetto
rafaelsachetto / .zshrc
Last active October 20, 2019 15:03
oh-my-zsh osx configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="kafeitu"
@rafaelsachetto
rafaelsachetto / kill.sh
Created December 6, 2013 17:06
jeito maroto de matar processos
ps aux | grep "PROCESS_NAME" | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
@rafaelsachetto
rafaelsachetto / Default (Linux).sublime-keymap
Created July 27, 2012 14:27
put into ~/.config/sublime-text-2/Packages/User
[
{ "keys": ["ctrl+'"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }
]
{
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"theme": "Oceanic Next.sublime-theme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".git",
".sass-cache",
"public/uploads/*",
"public/assets/*",
var LATIN_MAP = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'Ç':
'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Î': 'I',
'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Õ': 'O', 'Ö':
'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U', 'Ü': 'U', 'Ű': 'U',
'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a', 'â': 'a', 'ã': 'a', 'ä':
'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e', 'é': 'e', 'ê': 'e', 'ë': 'e',
'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i', 'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó':
'o', 'ô': 'o', 'õ': 'o', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u',
'û': 'u', 'ü': 'u', 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y'
@rafaelsachetto
rafaelsachetto / environment.rb
Created December 21, 2011 23:58
monkey path to support 18.446.744.073.709.551.615 records
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:primary_key] = "BIGINT UNSIGNED DEFAULT NULL auto_increment PRIMARY KEY"
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:reference] = "BIGINT UNSIGNED"
class ActiveRecord::ConnectionAdapters::TableDefinition
%w( string text integer float decimal datetime timestamp time date binary boolean reference ).each do |column_type|
class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{column_type}(*args) # def string(*args)
options = args.extract_options! # options = args.extract_options!
column_names = args # column_names = args
type = :'#{column_type}' # type = :string