Skip to content

Instantly share code, notes, and snippets.

View j0k3r's full-sized avatar

Jérémy Benoist j0k3r

View GitHub Profile
@j0k3r
j0k3r / mysqlinfo.php
Created September 23, 2010 19:11 — forked from pborreli/mysqlinfo.php
mysqlinfo - A phpinfo() like for mysql
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
a { text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: arial, helvetica, sans-serif; font-size: 18pt; font-weight: bold;}
h2 { font-family: arial, helvetica, sans-serif; font-size: 14pt; font-weight: bold;}
body, td { font-family: arial, helvetica, sans-serif; font-size: 10pt; }
th { font-family: arial, helvetica, sans-serif; font-size: 11pt; font-weight: bold; }
@j0k3r
j0k3r / .bashrc
Created November 10, 2010 17:20
.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
#export HISTCONTROL=ignoredups
@j0k3r
j0k3r / .vimrc
Created November 10, 2010 17:21
.vimrc
"--------------------------------------------------------------------
"
" NiLuJe's ViM Configuration File
"
" Highly inspired from Ciaran McCreesh's config
"
" (http://ciaranm.org/vimrc)
"
" $Id$
"
@j0k3r
j0k3r / gist:1042518
Created June 23, 2011 13:22
format_number_choice
<?php
echo format_number_choice(
'[0] aucun commentaire|[1] 1 commentaire|(1, +Inf] %1% commentaires',
array('%1%' => $nb_results),
$nb_results
)
?>
@j0k3r
j0k3r / gist:1043634
Created June 23, 2011 21:09
http auth on *_dev.php file for lighttpd
$HTTP["url"] =~ "^/(front|back)end_dev"
{
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/path/to/.passwdstats"
auth.require =
( "" =>
(
"method" => "basic",
"realm" => "auth required",
"require" => "valid-user"
@j0k3r
j0k3r / Utils.class.php
Created July 19, 2011 10:31
well well well
<?php
public static function hideInProd(){
if(sfConfig::get('sf_environment') == 'prod'){
return " style=\"display:none;\"";
}
}
@j0k3r
j0k3r / gist:1116875
Created July 31, 2011 15:11
removes these fsckin' cp-1252 characters from $text
<?php
// from @ubermuda: https://twitter.com/#!/ubermuda/status/85465832217518080
preg_replace('/[^(\x20-\x7F)]+/', '', $text);
@j0k3r
j0k3r / colorize-svn.sh
Created March 2, 2012 15:03 — forked from johnjohndoe/colorize-svn.sh
Colorize SVN & SVN DIFF
# Colorize SVN
# ------------
# Adds color to the output of commands like svn status and svn update.
# The original version of the script was posted by Ash_ on Stackoverflow
# Source: http://stackoverflow.com/questions/8786400/svn-add-colors-on-command-line-svn-with-awk-in-bash
function svn {
# Skip the color script when running an svn commit.
for x in "$@"; do
if [ $x = commit ] || [ $x = ci ]; then
command svn "$@";
@j0k3r
j0k3r / gist:1985336
Created March 6, 2012 09:40
`loadHelpers` without using `sfContext::getInstance()`
<?php
// instead of using
sfContext::getInstance()->getConfiguration()->loadHelpers('Url');
// use
sfApplicationConfiguration::getActive()->loadHelpers(array('Url'));

Keybase proof

I hereby claim:

  • I am j0k3r on github.
  • I am j0k (https://keybase.io/j0k) on keybase.
  • I have a public key ASBc10HMzZ8qQQMykV78NkiCTPzwuFkrJ3SBAAt_Nt-qrAo

To claim this, I am signing this object: