Skip to content

Instantly share code, notes, and snippets.

View lolautruche's full-sized avatar

Jérôme Vieilledent lolautruche

View GitHub Profile
@nebiros
nebiros / mb_str_pad.php
Created November 4, 2009 20:30
mb_str_pad
<?php
/**
* mb_str_pad
*
* @param string $input
* @param int $pad_length
* @param string $pad_string
* @param int $pad_type
* @return string
@tanakahisateru
tanakahisateru / gist:1344162
Created November 7, 2011 04:18
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@codingstyle
codingstyle / .bashrc
Created February 24, 2012 08:56
Colorful command line on MacOS X
#
# Dont forget to call ~/.bashrc in your ~/.profile script
#
export CLICOLOR=1
alias ll='ls -l'
alias la='ls -A'
alias vi='vim'
alias l='ls -CF'
@lolautruche
lolautruche / ezrouter.php
Created March 5, 2012 20:17
Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
<?php
/**
* Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
* WARNING !!! Use it for DEVELOPMENT purpose ONLY !!!
* This script is provided as is, use it at your own risk !
*
* @copyright Copyright (C) 2011 Jérôme Vieilledent. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@emodric
emodric / How to install Bsoad by Qafoo to test out the REST.txt
Created September 7, 2012 10:48
eZ Summer Camp 2012 / How to install & configure bsoad for VMs
How to install Bsoad by Qafoo to test out the REST API v2
The process to download bsoad and all dependencies is listed below.
1) cd /var/www/
2) git clone git://github.com/Qafoo/bsoad.git
3) cd bsoad
4) curl -s https://getcomposer.org/installer | php
5) php composer.phar install
6) cd src/library/qafoo/bdog
@return1
return1 / trim_enabler.txt
Last active August 25, 2023 02:59
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@naholyr
naholyr / git-pr.md
Created November 22, 2012 18:11
Using "hub" to automatically push & PR

git-pr

Part of my personal shortcuts for the usual pull-request-based workflow.

Setup

Given you have an "upstream" repository you need to work on:

  1. Fork it
  2. Clone your fork locally (repo "origin")