Skip to content

Instantly share code, notes, and snippets.

View paulopatto's full-sized avatar
🎯
Focusing

Paulo Patto paulopatto

🎯
Focusing
View GitHub Profile
#############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 16th March, 2009
# Verion: 2.0.0
# License: Public Domain - free to do as you wish
# Homepage: http://twhiteman.netfirms.com/des.html
#

Olá, presidenta Rousseff... eu lhe avisei

Carta impressa: escrita por Maddog

Jon "maddog" Hall

Querida Presidenta Rousseff,

Eu entendo que a senhora está irritada com meu país, os Estados Unidos da América, porque uma de

1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
$('.cep').blur(function() {
var cep = $(this).attr('value').replace(/-/, '');
$.ajax({
url : 'http://cep.correiocontrol.com.br/' + cep + '.json',
dataType: 'json',
success: function(data) {
console.log(data);
$('#address').attr('value', data.logradouro);
$('#neighborhood').attr('value', data.bairro);
$('#city').attr('value', data.localidade);

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@paulopatto
paulopatto / .pryrc.rb
Last active August 29, 2015 13:57 — forked from dlisboa/gist:9416144
Pryrc para usar o vim
require 'irb/completion'
def vi
require 'tempfile' unless defined? Tempfile
@f ||= Tempfile.new('irb-interactive')
system('vim', @f.path)
Object.class_eval File.read(@f.path) if $?.success?
end
at_exit do
puts @f.path
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
@paulopatto
paulopatto / .tmux.conf.old
Last active August 29, 2015 14:03 — forked from trcarden/gist:3295935
dotfiles
# $Id: screen-keys.conf,v 1.5 2009/10/25 21:58:05 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
@paulopatto
paulopatto / rubocop_pre_commit_hook
Last active April 19, 2017 07:49 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
# http://ruby-doc.org/stdlib-2.0.0/libdoc/English/rdoc/English.html
require 'English'
require 'rubocop'
ADDED_OR_MODIFIED = /^\s*(A|AM|M)\s*/
GIT_COMMAND = "git status --porcelain".freeze
modified_files = `#{GIT_COMMAND}`.split(/\n/)
@paulopatto
paulopatto / Algorithms.md
Last active April 2, 2018 04:31 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning
  • euclidean distance
  • pearson correlation coefficient
  • wighted mean
  • tanimoto coeficient
  • conditional probability
  • gini impurity
  • entropy
  • gaussian function
  • variance
  • dot products