Skip to content

Instantly share code, notes, and snippets.

André Abadesso andreabadesso

Block or report user

Report or block andreabadesso

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
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View Before and after image slider.markdown
View RedisPythonPubSub1.py
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@andreabadesso
andreabadesso / sign_request.js
Created Jul 4, 2014
Sign Google Maps for Business requests with the privateKey using Node.js
View sign_request.js
var crypto = require('crypto'),
url = require('url'),
URLSafeBase64 = require('urlsafe-base64');
function GenerateSignature(privateKey, query) {
var u = url.parse(query);
var urlToSign = u.path;
var decodedKey = URLSafeBase64.decode(privateKey);
var signature = crypto.createHmac('sha1', decodedKey).update(urlToSign);
var encodedSignature = URLSafeBase64.encode(signature.digest());
View codifica.c
int codifica(void* valores, char *campos) {
char tipo;
int acc = 0;
int i;
int temint = 0;
int ultimoChar = 0;
int padding = 0;
int pad = 0;
for (i=0;i<=strlen(campos);i++) {
@andreabadesso
andreabadesso / codifica.c
Created Apr 7, 2014
Trying to access struct members knowing the data format
View codifica.c
int codifica(void* valores, char *campos) {
char tipo;
int acc = 0;
int acc2 = 0;
int i;
for (i=0;i<=strlen(campos);i++) {
tipo = campos[i];
// p = *(int*)valores;
// v = (*((int*)valores+1));
You can’t perform that action at this time.