Skip to content

Instantly share code, notes, and snippets.

Alisson Sales alissonsales

  • Wellington, New Zealand
Block or report user

Report or block alissonsales

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alissonsales / redis-protocol-awk
Last active Aug 7, 2018
Redis protocol in awk
View redis-protocol-awk
awk '{ print "*" NF "\r"; for(i = 1; i <= NF; i++) { print "$" length($i) "\r\n" $i "\r" } }'
alissonsales /
Created Nov 27, 2017
Test ES sliced scroll
echo "ES version"
curl -s localhost:9200
echo "Create index"
curl -si -H 'Content-type: application/json' -X PUT localhost:9200/twitter -d '
"settings": {
"index": {
View gist:7829124
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
alissonsales /
Created Jan 26, 2012 — forked from MicahElliott/
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
View remove_trailing_spaces
if [ -f $1 ]
sed "s/[[:blank:]]*$//" "$1" > "$1.tmp"
mv "$1.tmp" "$1"
echo "File $1 does not exist.\n"
alissonsales / Gemfile
Created Apr 24, 2011
Test suite benchmark
View Gemfile
source ''
gem 'rails', '3.0.5'
gem 'pg'
gem 'inherited_resources', '~> 1.2.1'
gem 'haml'
gem 'formtastic', '~> 1.2.3'
gem 'capistrano'
gem 'clearance'
alissonsales / gist:776153
Last active Jan 28, 2019
Filmes e documentários para abrir sua mente
View gist:776153
Lista de documentários e filmes que considero como "obrigatórios", ou seja, todos deveriam assistir.
O critério usado para colocar um item na lista é: O documentário/filme mudou sua visão do mundo.
The Corporation -
The Story of Stuff -
The Genius of Charles Darwin -
BBC - Horizon: How Many People Can Live on Planet Earth? -
View Tray and Notifications Sample
import java.awt.AWTException;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.imageio.ImageIO;
View humanize_jira_time_sheet.js
var $;
// Add jQuery
if (typeof unsafeWindow.jQuery == 'undefined') {
var GM_Head = document.getElementsByTagName('head')[0] || document.documentElement,
GM_JQ = document.createElement('script');
GM_JQ.src = '';
GM_JQ.type = 'text/javascript';
View gist:360428
Valor do aparelho 7500 btus =/+ R$ 700
Potência do aparelho: 754 w
Em kilowatt-hora: 0,754 kwh
Consumo durante 8 horas: 0,754 kwh * 8h = 6.032 kw
Consumo 8 horas durante 30 dias = 6.032 kw * 30 = 180.96 kw
Valor do kwh: R$ 0.56290
180.96 kwh = +/- R$ 102
You can’t perform that action at this time.