Skip to content

Instantly share code, notes, and snippets.

@tluyben
tluyben / lddcollect
Created December 2, 2013 11:47
Lddcollect is a small tool which packs up and installs binaries, libraries and related files no a linux (possibly unix) machine.
#!/usr/bin/perl
use strict;
use warnings;
my $cmd = $ARGV[0];
if (scalar(@ARGV) < 2 or ($cmd ne "c" and $cmd ne "i" and $cmd ne "r")) {
print "Usage: lddcollect [cir] [binary/tgz/dir] [extra]\n\n";
print "Lddcollect is a small tool which packs up and installs binaries, libraries and related files.\n";
class Bla {
class A {
A() {
c();
}
void c() {
System.out.println("in A.c");
}
@tluyben
tluyben / csv2deviceids.pl
Created June 13, 2013 10:38
Convert a CSV to Apple iOS import plist format. The format in the samples from Apple is not complete and thus does not work. This one does (at least it does now).
#!/usr/bin/perl
$file = $ARGV[0];
$skip = $ARGV[1];
$prefix = $ARGV[2];
if (!$file or not -f $file) {
print "Usage: ./csv2deviceids.pl filename.csv [skip first n lines] [prefix]\n";
exit;
}
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.
Act I: Hamlet's insults and flattery.
Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward! You are as
maximum inquementum tum biguttam egresso scribe.
meo maximo vestibulo perlegamentum da.
da duo tum maximum conscribementa meis listis.
dum listis decapitamentum damentum nexto
fac sic
nextum tum novumversum scribe egresso.
lista sic hoc recidementum nextum cis vannementa da listis.
cis.
@tluyben
tluyben / gist:5604660
Last active December 17, 2015 11:49
Sinusscroller in Monkey
Function UpdateAd()
If Not gameScreen.adsOn Return
If _MouseClick() And _MouseIn(New Vector2D(0, SCREEN_HEIGHT-80), New Vector2D(SCREEN_WIDTH, 80))
LaunchNativeBrowser(ADLINK, ADLINK)
End
End
Function RenderAd()
If Not gameScreen.adsOn Return
SetColor 0,0,0
@tluyben
tluyben / gist:5563410
Created May 12, 2013 12:33
open msx compile zipit
#!/bin/sh
cd /home/openwrt/openmsx-openmsx
export STAGING_DIR=/home/openwrt/src/zipit/openwrt-zipit/staging_dir
export CXX=/home/openwrt/src/zipit/openwrt-zipit/staging_dir/toolchain-arm_v5te_gcc-4.6-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux-uclibcgnueabi-g++
make clean
rm -fR derived/*
make staticbindist OPENMSX_TARGET_CPU=arm CXX=$CXX OPENMSX_FLAVOUR=zipit LINK_MODE=3RD_STA_MIN
@tluyben
tluyben / gist:5553685
Created May 10, 2013 10:48
/etc/profile.d/zipit-mmc.sh
export PATH=/mnt/mmcblk0p1/usr/bin:/mnt/mmcblk0p1/bin:$PATH
export LD_LIBRARY_PATH=/mnt/mmcblk0p1/usr/lib
@tluyben
tluyben / gist:5553679
Created May 10, 2013 10:46
/etc/config/fstab
config 'mount'
option 'target' '/mnt/mmcblk0p1'
option 'device' '/dev/mmcblk0p1'
option 'fstype' 'ext2'
option 'options' 'ro'
option 'enabled' '1'
option 'enabled_fsck' '0'
@tluyben
tluyben / unpack ipk
Created May 10, 2013 10:30
Unpacking all ipkgs in some root directory
#!/usr/bin/perl
$d = $ARGV[0];
while(glob("$d/*.ipk")) {
chomp;
`tar xf $_`;
`tar pxzf data.tar.gz`;
}