Skip to content

Instantly share code, notes, and snippets.

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

Miguel Laginha brecke

🏠
Working from home
View GitHub Profile
// IE doesn't deal well with button elements.
// The following jQuery code fixes the two most common issues:
// 1. All button values being submitted whether they were clicked or not
// 2. Button labels being submitted instead of the value of the value attribute
// Make sure you have loaded jQuery, of course.
if ($.browser.msie) {
jQuery(function() {
$('form button[type=submit]').click(function() {
// Handle on the button clicked
@csanz
csanz / movingredistolinode.md
Created August 29, 2011 07:40
Moving your redis instance to linode

Move your redis instance to Linode!

create linode server instance

local:

<shell>$ssh root@(IP ADDRESS)

remote:

@wridgers
wridgers / .tmux.conf
Created February 7, 2012 16:05
tmux config file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g history-limit 1000
@pferreir
pferreir / .gitconfig
Created February 27, 2013 14:09
git blame is awesome, but I needed more.
[alias]
humiliate = "!sh -c 'RECIPIENTS=`git blame $0 -e -L $1 | sed \"s/.* (<\\(.*\\)> .*/\\1/\" | sort | uniq | paste -sd \",\" -` ; git blame $0 -L $1 | mail -s \"WTF is this?\" $RECIPIENTS;'"
from django.conf.urls import include, patterns, url as django_url
import re
def url(pattern, view, kwargs=None, name=None, prefix='', constraints={}):
'''
url('/path/:id/to/:something/', some_view, constraints={'id': r'\d{4}'})
'''
def convert(match):
name = match.group(1)
@laserlemon
laserlemon / Rails 3 Environment
Created October 1, 2010 12:17
Snow Leopard, Homebrew, Git, RVM, Ruby, Rails, Passenger, Apache, MySQL, Memcached and ImageMagick
# 2010-10-01
#
# Mac OS X 10.6.3
# Homebrew 0.7
# Xcode 3.2.4
# Git 1.7.3.1
# RVM 1.0.12
# Ruby 1.9.2, 1.8.7
# Rails 3.0.0
# Passenger 3.0.0.pre4
@laginha
laginha / calculadora.py
Last active August 4, 2016 10:50
Descontos para trabalhadores independentes
# -*- coding: utf-8 -*-
class Imposto(object):
def __init__(self, rendimento_anual_bruto):
self.rendimento_anual_bruto = rendimento_anual_bruto
self.rendimento_anual_de_incidencia = self.rendimento_anual_bruto * self.TAXA_DE_INCIDENCIA
self.rendimento_mensal_bruto = rendimento_anual_bruto /12
self.rendimento_mensal_de_incidencia = self.rendimento_anual_de_incidencia /12
class SegurancaSocial(Imposto):

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

@sixfeetover
sixfeetover / osx_homebrew_rvm_rails_unixodbc_sqlserver.md
Created September 4, 2010 19:49
Setup OS X 10.6.4 w/ homebrew, rvm, rails, unixodbc, freetds and SQL Server

Setup new mac from scratch

These commands are good as of 2010-11-18.

/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

Install xcode (download, or on the OS X install DVD)

http://developer.apple.com/technology/xcode.html
@roachhd
roachhd / ACTUAL-PROJECTS.md
Last active August 31, 2017 04:05
BADGES ❤ BADGES ❤ BADGES

######notepad Codeship Status for roachhd/Notepad

<a href="http://validator.w3.org/feed/check.cgi?url=http%3A//katieball.me//games/feed.xml"><img src="valid-rss-rogers.png" alt="[Valid RSS]" title="Validate my RSS feed" />RSS feed validation for /Games</a>

######Katieball.me/games RSS feed validation results Feed validation

######Markdown gitbook build status Build Status