Skip to content

Instantly share code, notes, and snippets.

View aumouvantsillage's full-sized avatar

Guillaume Savaton aumouvantsillage

View GitHub Profile
@aumouvantsillage
aumouvantsillage / sugar-for-struct-accessors.rkt
Last active July 6, 2020 15:42
Syntactic sugar to access Racket struct fields without prefixing them with the struct type name.
#lang racket
(require
syntax/parse/define
(for-syntax racket/syntax))
; Define an instance of a structure:
; - name: the name of the instance
; - sname: the name of the struct type
; - arg ...: the arguments for the struct type constructor
@aumouvantsillage
aumouvantsillage / tiny-hdl-example-v1.rkt
Last active May 26, 2020 20:54
Racket DSL example: Tiny-HDL
#lang racket
(require "tiny-hdl-macros.rkt")
(entity half-adder ([input a] [input b] [output s] [output co]))
(entity full-adder ([input a] [input b] [input ci] [output s] [output co]))
(architecture half-adder-arch half-adder
(assign (port-ref half-adder s) (xor (port-ref half-adder a) (port-ref half-adder b)))
@aumouvantsillage
aumouvantsillage / Building VC4CL
Created November 28, 2017 09:40
Building VC4C and VC4CL on a Raspberry Pi 3 with Raspbian Stretch
sudo apt install git cmake clang-3.9 opencl-headers ocl-icd-dev ocl-icd-opencl-dev
sudo ln -s /usr/bin/clang{-3.9,}
git clone https://github.com/doe300/VC4C.git
git clone https://github.com/doe300/VC4CL.git
git clone https://github.com/doe300/VC4CLStdLib.git
mkdir VC4C/build
cd VC4C/build
@aumouvantsillage
aumouvantsillage / gtk_entry_icons_gtk3.4.4.py
Created August 29, 2012 12:21
GTK entry icons with PyGObject and GTK3
from gi.repository import Gtk
#
# See https://gist.github.com/3508693 for the version with PyGTK and GTK2
#
# Create a GTK entry with a primary and secondary icons.
# Both icons are set sensitive.
#
# With GTK 2.24, if the entry is insensitive before the window is showed,
@aumouvantsillage
aumouvantsillage / gtk_entry_icons_bug.py
Created August 29, 2012 08:46
Bug in GTK2: icons in sensitive Entry appear grayed if the entry was insensitive at startup
import pygtk
pygtk.require("2.0")
import gtk
#
# Create a GTK entry with a primary and secondary icons.
# Both icons are set sensitive.
#
# If the entry is insensitive before the window is showed,
@aumouvantsillage
aumouvantsillage / click-on-use.svg
Created May 13, 2012 17:46
Click events on SVG elements referenced through <use>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aumouvantsillage
aumouvantsillage / gist:2431268
Created April 20, 2012 19:43
Sozi 12.04 hiding frame numbers
<!--
Sozi 12.04 adds frame numbers in the top-left corner of the screen
but no option (yet) to disable them.
Add this to your document if you really want to hide frame numbers.
It is safer not to modify the <style> element installed by Sozi:
it would be overwritten on the next upgrade.
-->
<style>
#sozi-framenumber {
@aumouvantsillage
aumouvantsillage / sozi-show-hide-objects.svg
Last active September 26, 2015 17:18
Sample Sozi document that shows/hides objects during the presentation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aumouvantsillage
aumouvantsillage / PKGBUILD
Created August 7, 2011 10:00
Archlinux PKGBUILD for glib2-ubuntu
pkgname=glib2-ubuntu
pkgver=2.29.14
_ubuntu_ver=0ubuntu1
pkgrel=1
pkgdesc="Common C routines used by GTK+ 2.4 and other libs"
url="http://www.gtk.org/"
arch=(i686 x86_64)
license=("LGPL")
depends=("pcre>=8.02")
provides=("glib2=${pkgver}")
@aumouvantsillage
aumouvantsillage / animate-frame-path.svg
Created November 18, 2010 13:13
How Sozi will handle transitions along a path
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.