Skip to content

Instantly share code, notes, and snippets.

View lucascarvalho's full-sized avatar

Lucas Carvalho lucascarvalho

View GitHub Profile
@lucascarvalho
lucascarvalho / redis.conf
Created March 30, 2017 14:38
Redis 2.8.4 Formula
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
setInterval(function() {
var bg,
backgrounds = {};
$('#box > span').each(function (index, element) {
bg = element.style["background-color"];
if (backgrounds.hasOwnProperty(bg)) {
backgrounds[bg].qnt += 1;
} else {
backgrounds[bg] = {qnt: 1, el: element};
@lucascarvalho
lucascarvalho / pre-commit
Created July 25, 2014 13:43
python flake8 git pre-commit hook
#!/usr/bin/env python
from __future__ import with_statement
import os
import shutil
import subprocess
import sys
import tempfile
def system(*args, **kwargs):