Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
It's 5.50 a.m.... Do you know where your stack pointer is?

Rodrigo Delduca skhaz

:octocat:
It's 5.50 a.m.... Do you know where your stack pointer is?
View GitHub Profile
View gist:5017547
"""
python <(curl https://gist.githubusercontent.com/skhaz/5017547/raw/7f76930c17ce0ec6c67c8a7fefe29fb2cc46d1f9/gistfile1.py)
"""
import requests
import re
def Ed(text):
params=dict(server='0.0.0.0:8085',charset_post='utf-8',
charset='utf-8',pure=1,js=0,tst=1,msg=text)
View client.py
import os
import zmq
import wiringpi
RED_PIN = 0
GREEN_PIN = 1
BLUE_PIN = 2
def main():
context = zmq.Context()
View gist:3960935
#include "HttpParserSettings.h"
#include "HttpConnection.h"
#include <QUrl>
#include <QByteArray>
#include <QHash>
#include <QMetaObject>
View gist:3958693
#ifndef _BinaryTree_h
#define _BinaryTree_h
template <class DataType>
class BinaryTree
{
private:
View gist:3801686
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
int hue = 0;
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
View gist:3741040
# -*- coding: utf-8 -*-
"""
Based upon www.splinter.com.au/converting-hsv-to-rgb-colour-using-c/
"""
from math import floor
def HSVtoRGB(h, s, v):
r, g ,b = 0, 0, 0
View gist:3439187
QFile *file = new QFile(filename);
QFileInfo info(*file);
QDir dir = info.dir();
QString filepath = dir.absolutePath();
if (!dir.mkpath(filepath)) {
qWarning("Error while creating the subdirectory %s", qPrintable(filepath));
}
@skhaz
skhaz / gist:3350974
Created Aug 14, 2012
A tribute to XKCD: the light comes on when I compile!
View gist:3350974
/*
* Based on this picture
* http://imgur.com/ZZxFy
*/
#include <cstdio>
#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>
View gist:2783188
QString atom(
"declare namespace atom = \"http://www.w3.org/2005/Atom\";\n"
"declare namespace media = \"http://search.yahoo.com/mrss/\";\n"
"doc($result)//atom:entry/media:group/media:player/@url/string()\n"
);
QXmlQuery query;
query.bindVariable("result", &buffer);
query.setQuery(atom);
@skhaz
skhaz / hack.sh
Created Apr 2, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#