Skip to content

Instantly share code, notes, and snippets.

View ludofleury's full-sized avatar
🐼
Yay

Ludovic Fleury ludofleury

🐼
Yay
View GitHub Profile
//How to read RFID tags with a mir:ror and nodejs
//Requires https://github.com/hanshuebner/node-hid
var HID = require('HID');
var devices = new HID.devices(7592, 4865);
var hid;
if (!devices.length) {
console.log("No mir:ror found");
} else {
hid = new HID.HID(devices[0].path);
@durran
durran / moped.txt
Created February 16, 2012 10:59
First run perf numbers, Moped.
##################################################################
# ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
# 10gen: mongo-1.5.2
# bson-1.5.2 (BSON::BSON_C)
##################################################################
user system total real
10gen: insert 10,000 blank documents 0.670000 0.060000 0.730000 ( 0.744400)
10gen: insert 10,000 blank documents safe mode 1.200000 0.140000 1.340000 ( 1.800714)
10gen: insert 1,000 normal documents 0.090000 0.010000 0.100000 ( 0.091035)
<?php
namespace OpenSky\Bundle\MainBundle\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\SecurityContextInterface;
/**
* Listens to kernel.request after the router and checks required role.
<?php
/*
* CLI report.
*/
$stdOutWriter = new \mageekguy\atoum\writers\std\out();
$cli = new \mageekguy\atoum\reports\realtime\cli();
$cli->addWriter($stdOutWriter);
/*
@everzet
everzet / watch.rb
Created April 11, 2012 13:31
https://github.com/mynyml/watchr script to continuously run Behat and PHPUnit test suites on classes/features that have been modified.
watch( '(src/.*\.feature)$' ) {|md| system("./console -e=test behat -fprogress #{md[1]}") }
watch( '(src/.*\.php)$' ) {|md| system("phpunit -c app src") }
anonymous
anonymous / gist:3038535
Created July 3, 2012 08:41
server {
listen 80;
root /srv/www/example.com;
server_name example.com;
location / {
try_files $uri /app.php$is_args$args;
}
<?php
class phpClass {};
class_alias('phpClass', 'class');
$className = 'class';
$class = new $className();
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Jean-Pierre subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="innovation" title="innovation">
<outline type="rss" text="Pl4n3s world" title="Pl4n3s world" xmlUrl="http://pl4n3.blogspot.com/feeds/posts/default?alt=rss" htmlUrl="http://pl4n3.blogspot.com/"/>
<outline type="rss" text="Mozilla Hacks - the Web developer blog" title="Mozilla Hacks - the Web developer blog" xmlUrl="http://hacks.mozilla.org/feed/" htmlUrl="https://hacks.mozilla.org"/>
<?php
namespace Playbloom\Tests;
use Doctrine\DBAL\Driver\PDOMySql\Driver;
class MysqlDriver extends Driver
{
private static $connection;
@GitsMcGee
GitsMcGee / circle.yml
Created December 14, 2014 22:42
CircleCI config for Play 2.3 and Elastic Beanstalk
machine:
environment:
JAVA_TOOL_OPTIONS: '-Dfile.encoding=UTF8 -Duser.timezone=UTC'
_JAVA_OPTIONS: '-Xms512m -Xmx1024m -Xss2m'
java:
version: oraclejdk8
python:
version: 2.7.6
services:
- docker