Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
jehoshua02 / xdebug.ini
Created December 22, 2011 16:40
Copy to php.ini
; XDEBUG Extension
zend_extension = "c:\wamp\bin\php\php5.3.5\ext\php_xdebug-2.1.2-5.3-vc6.dll"
[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.profiler_enable = off
@jehoshua02
jehoshua02 / alternate_control_syntax.md
Created December 23, 2011 03:21
Yuriy should use git and gist more often

Here's your code revised to use alternate syntax for control structures, convenient for using within templates:

<?php $cont_disp = ($cont_disp); ?>
<?php if ($cont_disp[0] == ""): ?>

    <!-- show nothing -->

<?php else: ?>
@jehoshua02
jehoshua02 / indentation.php
Created December 30, 2011 20:46
Ranting about sloppy indentation . . .
<?php
if ($joseph->does_not_mind_rant())
{
echo "Why can't these guys indent consistently?!?"
echo "This code looks like it was written by a fifth grader! Seriously!"
}
else
{
$joshua->keep_quiet();
@jehoshua02
jehoshua02 / notes.md
Created February 4, 2012 21:34
Installing Chiliproject . . .

Following steps here: https://www.chiliproject.org/projects/chiliproject/wiki/Installation_on_CentOS_5

Tripped on step 2:

[root@localhost ~]# yum -y install gcc zlib zlib-devel curl curl-devel expat-devel gettext-devel httpd httpd-devel apr-devel apr-util-devel mysql mysql-server mysql-devel openssl openssl-devel make gcc-c++ patch readline-devel ImageMagick ImageMagick-devel libffi-devel libyaml-devel sudo git subversion

Error: Package: perl-Git-1.7.4.1-1.el5.i386 (epel)
           Requires: perl(:MODULE_COMPAT_5.8.8)
Error: Package: git-1.7.4.1-1.el5.i386 (epel)

Requires: libcurl.so.3

@jehoshua02
jehoshua02 / rvm_install_ree.md
Created February 6, 2012 20:14
Installing ree on fresh CentOS 6.2 x86_64 minimal install . . .

Having some trouble running rvm install ree on a fresh CentOS 6.2 x86_64 minimal install.

Here's what it looks like:

[chili@projects ~]$ rvm reinstall ree
Removing /home/chili/.rvm/src/ree-1.8.7-2012.01...
Removing /home/chili/.rvm/rubies/ree-1.8.7-2012.01...
Removing ree-1.8.7-2012.01 aliases...
Removing ree-1.8.7-2012.01 wrappers...
Removing ree-1.8.7-2012.01 environments...
@jehoshua02
jehoshua02 / post-receive_error.md
Created February 7, 2012 23:26
post-receive error...
js@JS-LAPTOP /d/projects/test (master)
$ git remote add origin [email protected]:test.git

js@JS-LAPTOP /d/projects/test (master)
$ git push -u origin master
Enter passphrase for key '/c/Users/js/.ssh/id_rsa':
Counting objects: 3, done.
Writing objects: 100% (3/3), 210 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: cannot run hooks/post-receive: No such file or directoryremote: /usr/bin/env:
@jehoshua02
jehoshua02 / compare_version.php
Created February 17, 2012 21:41
Comparing software versions ...
<?php
function compare_version($version_a, $version_b, $limit = 2)
{
$a_segments = explode('.', $version_a);
$b_segments = explode('.', $version_b);
$sentinel = min(sizeof($a_segments), $limit);
for ($i = 0; $i < $sentinel; $i++)
@jehoshua02
jehoshua02 / quicklaunch.py
Created February 22, 2012 18:07
Launches everything in ./shortcuts/ folder
# purpose: open all files in a directory as if each were double-clicked
# allowing the user to throw a bunch of program shortcuts into a
# directory and run this script to open them all.
# imports
import os
# declarations
shortcuts = os.getcwd() + '/shortcuts'
files = os.listdir(shortcuts)
@jehoshua02
jehoshua02 / product_entry.html
Created February 25, 2012 17:24
product entry ....
<!--Begin hidden rollover-->
<a href="http://localhost/allibellenyc/index.php?route=product/product&amp;path=59&amp;product_id=51" class="ProductRollover">
<div class="ProductRolloverBackground">
</div>
<div class="ProductInfo">
<div class="name">
<a href="http://localhost/allibellenyc/index.php?route=product/product&amp;path=59&amp;product_id=51">Mohawk Satchel</a>
</div>
<div class="description">..</div>
@jehoshua02
jehoshua02 / is_leap_year.php
Created February 29, 2012 23:29
function to determine if year is a leap year
<?php
function is_leap_year($year = NULL)
{
if (empty($year)) $year = date('Y');
return ($year % 4 == 0 && ($year % 100 != 0 || $year % 400 == 0));
}