Skip to content

Instantly share code, notes, and snippets.

View caarlos0's full-sized avatar
🍄

Carlos Alexandro Becker caarlos0

🍄
View GitHub Profile
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@millermedeiros
millermedeiros / osx_setup.md
Last active March 23, 2025 01:23
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

class Module
def dispatch(*klasses, last)
last_klass, mid = last.first
klasses << last_klass
__dispatch_list << [klasses, instance_method(mid)]
define_method(mid, __dispatch_proc(__dispatch_list))
end
def __dispatch_list
@__dispatch_list ||= []
@carlosspohr
carlosspohr / Charlao.txt
Last active December 20, 2015 23:48
Causos
Teve um maluco aqui em medianeira que atropelou um cara cagando no começo da manhã.
O cara vinha bêbado de moto e passou direto na rua da rodovia e entrou num matinho e
deu no meio de um cara cagando lá.
Resultado: um cara todo cagado com a perna quebrada e o atropelador caído dentro umas
manilhas da sanepar...e o atropelador teve que pagar um ano de seguro desemprego pro
atropelado ainda :D
-- Maconha pro morcego
@gmcoringa
gmcoringa / CommitsRegulares.md
Last active December 20, 2015 13:29
Commits Regulares

##Commits Regulares

Commits Regulares baseiam-se na prática de comitar suas alterações regularmente no controle de versão, ou seja, no mínimo uma vez por dia. Desta forma as alterações são disponibilizadas para outros desenvolvedores em partes, o que facilita o uso de outras praticas, como code review, integração continua, etc.

####Pontos de Atenção

Porém, desenvolvedores devem ter cuidado sobre os efeitos de seus comits, se planejando melhor, e as vezes fazendo uso de tecnicas, como configurações para habilitar e desativar uma funcionalidade.

####Porque comitar regularmente

$ = jQuery
$.fn.lineHeight or= ->
if height = @data('lineHeight')
return height
# Create a hidden div with the same font
# properties, then measure its height
$shadow = $('<span />')
$shadow.css({
@burke
burke / remotepaste.md
Last active March 21, 2025 18:37
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
var itens = [
'apple',
'grape',
'orange'
];
itens
.join(',')
.replace(/(\w+(?!=\,))/g, '<li>\$1<\li>')
.split(',');
@rodrigobaron
rodrigobaron / mvps_hosts.sh
Created May 29, 2013 12:25
Block ads .. banner and another shits ..
# -*- coding: UTF-8 -*- # ###################################################
# #
# mvps_hosts - Sync MVPS HOSTS #
# #
# DESCRIPTION #
# The Sync MVPS HOSTS backup your hosts file ... download the mvps hosts #
# and join into the new hosts file... if you need add or remove a custom host #
# change the older file "/etc/hosts_bak" #
# #
# REQUERIMENT #
@egonSchiele
egonSchiele / dining.rb
Last active September 22, 2018 12:23
Dining philosophers in Ruby with Celluloid. Modified from https://gist.github.com/bugant/4984042
require 'rubygems'
require 'celluloid'
class Waiter
include Celluloid
FORK_FREE = 0
FORK_USED = 1
attr_reader :philosophers
attr_reader :forks
attr_reader :eating