Skip to content

Instantly share code, notes, and snippets.

@nicmart
nicmart / gist:94aa30f10c42ca47f004
Created May 9, 2014 10:55
Extension client page test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML5 basic skeleton</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style type="text/css">
@nicmart
nicmart / lesscdir
Last active December 16, 2015 01:09 — forked from gbonanome/lesscdir
#!/bin/bash
# file name: lesscdir
# Compile every .less found under a specified folder
# $1 is the folder to search
# $2 allows to use a lessc parameters for compiling
if [[ -z $1 ]];then
echo 'Specify a directory to search'
exit
@nicmart
nicmart / mediawiki-globals-1.20.php
Created March 8, 2013 15:20
Mediawiki 1.20 globals. Wrapping mediawiki code into a symfony application forced me to explicitly declare all global variables (more than 800!). This is the file I include for that declarations.
<?php
/*
* This file lists all global variables found in Medawiki 1.20
*
* (c) 2013 Nicolò Martini <nicmartnic@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
[user]
name = Nicolò Martini
email = electroportal.net@gmail.com
[github]
user = nicmart
token = xxxx
[core]
excludesfile = /Users/nic/.gitignore_global
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
@nicmart
nicmart / current
Last active December 11, 2015 16:08
I have to choose the more elegant interface for selectors for the treebuilder library. Here I post some alternatives to se how they look like.
<?php
// Current interface
$tree
->leaf('element', 'author')
->key('value', 'author_name')
->value('element', 'name')
->end()
->leaf('element', 'date')
->value(function(\DateTime $dateTime) { return $dateTime->format('d-m-Y'); })