Skip to content

Instantly share code, notes, and snippets.


Grégoire Pineau lyrixx

View GitHub Profile
View php-bench-01.php
class baseDog
public $name;
class dog
protected $name;
remi / .gitconfig
Created Jul 27, 2011
Alias pour utiliser git en français!
View .gitconfig
etat = status
pousser = push
tirer = pull
commettre = commit
ranger = stash
ajouter = add
enlever = rm
cloner = clone
fusionner = merge
ziadoz /
Last active Jul 25, 2022
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
ruckus / gist:2293434
Created Apr 3, 2012
Basic setup of WAL-E for continuous archiving and recovery
View gist:2293434

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
ladyada /
Created Aug 10, 2012
Adafruit Light Painting with Pi
# Light painting / POV demo for Raspberry Pi using
# Adafruit Digital Addressable RGB LED flex strip.
# ---->
import RPi.GPIO as GPIO, Image, time
# Configurable values
filename = "hello.png"
webmozart / git-find-merge
Created Nov 15, 2012
Script to find the merge and PR a commit occurred in
View git-find-merge
if [ -z $BRANCH ]; then
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' \
<(git rev-list --ancestry-path --oneline $COMMIT..$BRANCH) \
naholyr /
Created Dec 13, 2012
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
n1k0 / 404checker.js
Created Jan 11, 2013
A CasperJS script to check for 404 & 500 internal links on a given website
View 404checker.js
* This casper scipt checks for 404 internal links for a given root url.
* Usage:
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
/*global URI*/
nikic /
Last active Jun 3, 2022
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

hSATAC / gist:5343225
Created Apr 9, 2013
Http Redirect in Golang
View gist:5343225
package main
import (
func redirect(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "", 301)