Skip to content

Instantly share code, notes, and snippets.

View fgm's full-sized avatar

Frédéric G. MARAND fgm

View GitHub Profile
@fgm
fgm / KernelCommands.php
Created December 19, 2017 14:34
Dump Drupal listeners, including subscribers
<?php
// Place in (module)/src/Commands
namespace Drupal\rdcm\Commands;
use Drush\Commands\DrushCommands;
use Robo\Common\OutputAwareTrait;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Yaml\Yaml;
@fgm
fgm / Symfony2 GraphvizDumper demo
Last active November 18, 2017 17:14
Demonstrate how to use the GraphViz Dumper in a Symfony 2.4 project.
<?php
/**
* @file
* gvdump.php
*
* @author: Frédéric G. MARAND <fgm@osinet.fr>
*
* @copyright (c) 2014 Ouest Systèmes Informatiques (OSInet).
*
* @license MIT
@fgm
fgm / # php70 - 2016-10-28_14-44-32.txt
Created October 28, 2016 13:48
php70 (homebrew/php/php70) on macOS 10.12.1 - Homebrew build logs
Homebrew build logs for homebrew/php/php70 on macOS 10.12.1
Build date: 2016-10-28 14:44:32
@fgm
fgm / # php70 - 2016-10-28_14-44-32.txt
Created October 28, 2016 13:48
php70 (homebrew/php/php70) on macOS 10.12.1 - Homebrew build logs
Homebrew build logs for homebrew/php/php70 on macOS 10.12.1
Build date: 2016-10-28 14:44:32
@fgm
fgm / keybase.md
Created September 17, 2016 17:28

Keybase proof

I hereby claim:

  • I am fgm on github.
  • I am fgm (https://keybase.io/fgm) on keybase.
  • I have a public key whose fingerprint is 134F 30CA B7AE 45B8 E50E 7756 EC88 8C26 7F6E 6384

To claim this, I am signing this object:

<?php
/**
* Stubs generated from the mongodb extension using:
* Fgm\StubGenerator\StubDumper 2.0.0
*
* Name : mongodb
* Version : 1.1.7
* INI entries : 1
* - mongodb.debug = /tmp/mongodb_php.log
*/
@fgm
fgm / compile.bash
Last active January 2, 2016 12:44
2D graphics example using the g2 library
#! /bin/bash
set -x
# Exécution d'un programme utilisant la bibliothèque graphique g2
name=`basename -s.c $1`
cc $name.c -L/usr/local/lib -lg2 -L/usr/X11R6/lib -lm && ./a.out
@fgm
fgm / gist:8261606
Created January 4, 2014 22:31
A Symfony2 Console command to list the Doctrine DBAL valid column types and options.
<?php
/**
* @author: Frederic G. MARAND <fgm@osinet.fr>
*
* @copyright (c) 2013 Ouest Systèmes Informatiques (OSInet).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@fgm
fgm / simpletest-clean.js
Last active November 4, 2015 17:12
Drop the MongoDB Simpletest collections from a Drupal 7 database
var collections = db.getCollectionNames();
collections.forEach(function(e) {
if (e.match(/^simpletest/)) {
db[e].drop();
}
});
// And the one-liner version, simple to paste.
db.getCollectionNames().forEach(function(e) { if (e.match(/^simpletest/)) { db[e].drop();}});
package main
import (
"net/http"
"fmt"
)
func main() {
mux := http.NewServeMux()