Skip to content

Instantly share code, notes, and snippets.

View piranna's full-sized avatar

Jesús Leganés-Combarro piranna

View GitHub Profile
@riston
riston / gist:2973580
Created June 22, 2012 15:43
Reading /dev/psaux stream with nodejs
var fs = require('fs');
var readStream = fs.ReadStream('/dev/psaux');
var mouseMovements = [];
readStream.on('data', function(packet) {
var buf = packet.readInt8(0);
var mouse = {
leftBtn: !!(buf & 1)
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@mbostock
mbostock / .block
Last active October 12, 2024 05:42 — forked from mbostock/.block
Stacked Bar Chart
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-stacked-bar-chart
/*
* This example code is placed in the public domain
*
* Author: Owen Taylor <otaylor at redhat.com>, Red Hat Inc.
*/
#include <cairo-win32.h>
#define TITLE TEXT("Cairo test")
@creationix
creationix / output.log
Created May 8, 2013 22:02
Working version of generator async code sample. Using node from https://github.com/andywingo/node/tree/v8-3.19
tim@touchsmart:~/Code$ nvm use v0.11.2-generators
Now using node v0.11.2-generators
tim@touchsmart:~/Code$ node --harmony testgen.js
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...>
Sleeping for 2000ms...
Done
@zellio
zellio / fbterm-hacks.md
Last active June 26, 2025 20:18
fbterm, installation and configuration hacks

fbterm setup and config hacks

Installation and setup

Install fbterm via your favorite package manager

pacman -S fbterm
@rossant
rossant / raytracing.py
Last active February 19, 2025 01:38
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@rofl0r
rofl0r / init.c
Created August 6, 2013 21:15
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@jfburdet
jfburdet / automatic-backup-to-ext-usb-drive.rules
Last active December 23, 2024 18:05
Automatic full rsync backup of a linux machine when a given disk is connected. Simply plug the disk ... wait until the led doesnt blink anymore, pull it back, then store it at the remote storage side and bring the other disk next time. Full offsite backup for dummies. /etc/udev/rules.d/automatic-backup-to-ext-usb-drive.rules /root/.config/back_u…
ACTION=="add", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="0748", RUN+="/root/.config/back_usb/back_entry_point.sh"
@mzabriskie
mzabriskie / README.md
Last active June 30, 2025 23:47
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.