Skip to content

Instantly share code, notes, and snippets.

View adaedra's full-sized avatar

Thibault “Adædra” Hamel adaedra

View GitHub Profile
def  2
3
end
puts 2 + 2
<?php
require('vendor/autoload.php');
$tmpfile = tempnam(sys_get_temp_dir(), 'hbs');
error_log($tmpfile);
$tmpl_src = <<<'HBS'
{{{test foo="bar"}}}
HBS;
$tmpl = LightnCandy::compile($tmpl_src, Array(
// Generated by CoffeeScript 1.8.0
var Handlebars, source, template;
Handlebars = require('handlebars');
Handlebars.registerHelper('def', function(title, options) {
return '<dt>' + title + '</dt><dd>' + options.fn(this) + '</dd>';
});
source = '<dl>{{#def \'Wello\'}}Hello {{who}}{{/def}}</dl>';
<?php
require 'vendor/autoload.php';
$template = <<<"HTML"
<dl>
{{#def "Wello horld"}}
Hello {{who}}
{{/def}}
</dl>
@adaedra
adaedra / anetzen-patch.patch
Created July 4, 2012 12:01
anetzen (1) : Fix for SIGSEGV under Linux-x86_64
Index: ACoreApp.cc
===================================================================
diff --git a/ACoreApp.cc b/ACoreApp.cc
--- a/ACoreApp.cc (revision 32)
+++ b/ACoreApp.cc (working copy)
@@ -20,7 +20,7 @@
#include "ANetSoul.hh"
#include "AChatWindow.hh"
-ACoreApp::ACoreApp(int argc, char** argv) : QApplication(argc, argv)
@adaedra
adaedra / gist:3403964
Created August 20, 2012 13:21
Ruby vs JRuby
(pegasus) % cat benchmark.rb
#!/usr/bin/env ruby
t_b = Time.now.to_f
# 50'000 * sin [ -90 .. 90 ]
50000.times do
( -90 .. 90 ).each do |x|
Math.sin(x)
H4sIACyiOFAAA0tNzshX8DAp9nT0Sszwd3N0dDQo86lyLQkqdAsIDEk09AwJi/IMyawIMnA2DMn0zvUvDAv3LE6NdHb0rzIv9Q1NBupwVKhRSEosTjUzUdB1AbLTS/OqMgsUdJMVdIG84gwuAM5BcGZlAAAA
@adaedra
adaedra / gist:3632783
Created September 5, 2012 07:45
PKGBUILD for lib32-gdbm
# Maintainer: josephgbr <rafael.f.f1 at gmail.com>
# Contributor: Maribu <leonidas200 at web dot de>
_pkgbase=gdbm
pkgname=lib32-$_pkgbase
pkgver=1.10
pkgrel=1
pkgdesc="GNU database library (32 bit)"
license=('GPL')
url="http://www.gnu.org/software/gdbm/gdbm.html"
@adaedra
adaedra / gist:3851553
Created October 8, 2012 09:11
Objective-C Mangling FAIL !
#import <Edifice/EdObject.h>
#import <stdio.h>
@interface Test : EdObject
- (void) test: (int) i;
- (void) test_;
@end
@adaedra
adaedra / gist:3888306
Created October 14, 2012 11:34
Ruby implementations comparison
adaedra@pegasus % ./test.rb
Test "sinusTest" runned in 1.340s
Test "loopTest" runned in 6.249s
Test "arrayTest" runned in 1.810s
Test "randomTest" runned in 3.110s
Test "sortTest" runned in 1.774s
Test "threadsTest" runned in 5.762s
Total time run : 20.045s
adaedra@pegasus % rvm use jruby
Using /usr/local/rvm/gems/jruby-1.6.8