Skip to content

Instantly share code, notes, and snippets.

View weotch's full-sized avatar
👋
Heya

Robert Reinhard weotch

👋
Heya
View GitHub Profile
@weotch
weotch / .bash_profile
Created April 2, 2013 15:53
Adding MAMP's PHP to your PATH. Your profile may be ~/.bash_profile or ~/.profile.
PATH="/usr/local/sbin:/usr/local/bin:/usr/local/share/python:~/bin:/usr/local/share/npm/bin:/Applications/MAMP/bin/php/php5.3.6/bin:$PATH"
export PATH
@weotch
weotch / gist:4127482
Created November 21, 2012 20:34
Using modulo
<?
foreach($whatever as $i => $item) {
if ($i%3 === 0) //Open the ul
// Show the li like normal
if ($i%3 === 2 || count($whatever) - 1 === $i) // Close the ul
}
@weotch
weotch / gist:1959748
Created March 2, 2012 17:16
Running PHP scripts from CLI on Heroku
# Add this config
$ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
# Login to Heroku CLI
$ heroku run bash
# The second argument here is the path to your script
~ $ ~/php/bin/php -f ~/www/index.php