Skip to content

Instantly share code, notes, and snippets.

View ghedo's full-sized avatar
:shipit:
🔥 This is fine 🔥

Alessandro Ghedini ghedo

:shipit:
🔥 This is fine 🔥
View GitHub Profile
ASM=nasm
ISO=genisoimage -input-charset utf-8 -boot-load-size 4 -no-emul-boot -r
all: boot.iso
boot.bin: boot.asm
$(ASM) -o boot.bin boot.asm
boot.iso: boot.bin
mkdir iso/
@ghedo
ghedo / index.html
Last active February 14, 2019 02:30
Lightweight tooltip plugin for jQuery (http://bl.ocks.org/955408)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="microTip.js"></script>
<title>microTip.js - Extremely lightweight tooltip plugin for jQuery</title>
<style>
p#microtip{
@ghedo
ghedo / MMA8452Q.cpp
Last active August 11, 2018 16:57
Arduino library for the MMA8452Q three-axis accelerometer
/*
* Arduino library for the MMA8452Q three-axis accelerometer.
*
* The MMA8452Q is a tiny and low-power three-axis accelerometer. This
* library implements a simple interface to access most of the chip
* functionality from an Arduino.
*
* FEATURES:
* + Normal and fast raw axes values reading
* + Scale configuration (allowed 2g, 4g and 8g scales)
@ghedo
ghedo / systemd-start-and-wait.go
Last active May 4, 2018 13:51
Start a systemd unit and wait until it stops
package main
import "log"
import "os"
import "github.com/docopt/docopt-go"
import "github.com/godbus/dbus"
const target string = "org.freedesktop.systemd1";
const object string = "/org/freedesktop/systemd1";
@ghedo
ghedo / bipipe.c
Created August 13, 2013 14:22
Bidirectional pipe
/*
* Bidirectional pipe
*
* Compile:
* $ cc -o bipipe bipipe.c
*
* Examples:
*
* * Unix domain socket chat over SSH:
*

Keybase proof

I hereby claim:

  • I am ghedo on github.
  • I am ghedo (https://keybase.io/ghedo) on keybase.
  • I have a public key whose fingerprint is A4F4 55C3 414B 1056 3FCC 9244 AFA5 1BD6 CDE5 73CB

To claim this, I am signing this object:

@ghedo
ghedo / wr
Last active October 26, 2015 03:28
Translate a word using wordreference.com
#!/usr/bin/perl
# Usage: wr <term> [<dict>]
# Translate a word using wordreference.com
use strict;
use warnings;
use feature qw(say);
@ghedo
ghedo / jsonpretty.c
Last active October 5, 2015 09:07
Stupid JSON prettifier
/*
* Stupid JSON prettifier.
*
* Compile:
* $ cc -o j jsonpretty.c -ljansson
*
* Usage:
* $ ./j < <file>
* $ cat <file> | ./j
*
@ghedo
ghedo / ffi_raw_file.pl
Last active October 4, 2015 00:58
FFI::Raw and stdio's FILE
#!/usr/bin/perl
use strict;
use warnings;
use FFI::Raw;
use IO::Handle;
my $fopen = FFI::Raw -> new(
'libc.so.6', 'fopen',
@ghedo
ghedo / sprunge
Created March 11, 2012 16:21
Paste stuff to sprunge.us
#!/bin/sh -e
# Usage: sprunge < <file>
# Paste stuff to sprunge.us
if [ -t 0 ]; then
echo "Usage: sprunge < some_file.txt"
else
curl -sF 'sprunge=<-' http://sprunge.us < /dev/stdin
fi