Skip to content

Instantly share code, notes, and snippets.

Bastien Durel BastienDurel

Block or report user

Report or block BastienDurel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mysql2sqlite.sh
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
View Makefile
SRC=main.cpp
OBJ=$(SRC:.cpp=.o)
OPT=-g -O2
ifneq ($(THREADS),)
OPT+=-DNUM_THREADS=$(THREADS)
endif
ifeq ($(WORK),1)
OPT+=-DWORK
@BastienDurel
BastienDurel / Makefile
Last active Aug 29, 2015
push/pull test
View Makefile
SRCC=client.cpp
SRCS=server.cpp
OBJC=$(SRCC:.cpp=.o)
OBJS=$(SRCS:.cpp=.o)
ifneq ($(NOKEEPALIVE),1)
KA=-DDOKEEPALIVE=1
endif
OPT=-g -O2
@BastienDurel
BastienDurel / test-db-oracle.pl
Created Feb 19, 2014
DBD::Oracle::db do failed: ORA-14452: attempt to create, alter or drop an index on temporary table already in use (DBD ERROR: error possibly near <*> indicator at char 15 in 'drop table SYS.<*>test_foobar') [for Statement "drop table SYS.test_foobar"] at test-dbi-oracle.pl line 17.
View test-db-oracle.pl
#!/usr/bin/perl
use strict;
use warnings;
use DBI qw(:sql_types);
use DBD::Oracle qw(:ora_session_modes);
my $run = 1;
$SIG{INT} = sub { $run = 0; print "Stopping ...\n"; };
View gist:8978392
#!/usr/bin/perl
use strict;
use threads;
use Proc::Daemon;
sub do_nothing {
sleep 1 while 1;
}
threads->create(\&do_nothing);
@BastienDurel
BastienDurel / repro-gerror-bug.pl
Last active Dec 22, 2015
Trigger gerror bug in perl-gtk3
View repro-gerror-bug.pl
#!/usr/bin/perl -CSD
use strict;
use warnings;
use Gtk3 -init;
use Gtk3::WebKit qw(:xpath_results :node_types);
use Data::Dumper;
use Carp;
$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };
You can’t perform that action at this time.