Skip to content

Instantly share code, notes, and snippets.

Youri Ackx yackx

View GitHub Profile
View lfs-library-check.sh
#!/bin/bash
for lib in lib{gmp,mpfr,mpc}.la; do
echo $lib: $(if find /usr/lib* -name $lib|
grep -q $lib;then :;else echo not;fi) found
done
unset lib
@yackx
yackx / boot1.asm
Created Dec 21, 2016
Bootload FAT12
View boot1.asm
;*********************************************
; Boot1.asm
; - A Simple Bootloader
;
; Operating Systems Development Tutorial
;*********************************************
bits 16 ; we are in 16 bit real mode
@yackx
yackx / intersect-bug.groovy
Created Aug 26, 2016
Check for Collection.intersect() bug that affects some Groovy versions
View intersect-bug.groovy
// Check Groovy intersect bug
def checkIntersectBug() {
def foo = [[1], [2], [3]]
def bar = [[2], [3], [4]]
if (foo.intersect(bar).size() != 2) {
println '''Warning!
The version of Groovy that you are running contains a bug on Collection.intersect().
Upgrade to 2.4.7 or later.
See http://stackoverflow.com/questions/35493088/groovy-strange-collectionintersect-behaviour
@yackx
yackx / 2016.groovy
Created Jan 2, 2016
Mind-blowing 2016 facts
View 2016.groovy
assert (1..63).sum() == 2016
assert 666 + 666 + 666 + 6 + 6 + 6 == 2016
@yackx
yackx / hello-boot.asm
Created Dec 10, 2014
Hello World bootloader in assembly language
View hello-boot.asm
;----------------------------------------------;
;
; A minimal bootloader that prints a hello world
; then halts.
;
; nasm -f bin hello-boot.asm -o hello-boot.bin
;
; @YouriAckx
;
;----------------------------------------------;
@yackx
yackx / gist:a9bf4e4e639e68907c14
Created May 7, 2014
Remove trailing spaces inserted by Hippo CMS at the end of some .xml files
View gist:a9bf4e4e639e68907c14
#!/usr/bin/env groovy
/*
* Remove nasty trailing spaces inserted by the naughty Hippo
* at the end of some .xml files.
*/
@Grab('org.apache.commons:commons-lang3:3.3.1')
import org.apache.commons.lang3.StringUtils
@yackx
yackx / peano.go
Created Feb 5, 2014
Peano integers in Go
View peano.go
// Peano integers are represented by a linked
// list whose nodes contain no data
// (the nodes are the data).
// http://en.wikipedia.org/wiki/Peano_axioms
package main
import "fmt"
// Number is a pointer to a Number
View philosophers.groovy
#!/usr/bin/env groovy
import static groovyx.gpars.GParsPool.withPool
import groovy.transform.*
import java.util.concurrent.*
@TypeChecked
class Philosopher {
You can’t perform that action at this time.