This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Foo { | |
| public static function map(){ | |
| /* | |
| $file_dir = Registry::getParam("Config","file_dir")."libs/"; | |
| $elements_dir = "HTMLBuilder/Elements"; | |
| $dir = Utilities::getDirRecursive($file_dir.$elements_dir); | |
| foreach($dir as $key => $class){ | |
| $class_levels = explode("/",$class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // include the cart class | |
| include("Cart_Calculator.class.php"); | |
| // set up a test array of products. | |
| $cart[0]['title'] = 'Product 1'; | |
| $cart[0]['price'] = isset($_REQUEST['cart'][0]['price']) ? $_REQUEST['cart'][0]['price'] : '12.99'; | |
| $cart[0]['qty'] = isset($_REQUEST['cart'][0]['qty']) ? $_REQUEST['cart'][0]['qty'] : '3'; | |
| $cart[0]['discount'] = isset($_REQUEST['cart'][0]['discount']) ? $_REQUEST['cart'][0]['discount'] : '0'; | |
| $cart[0]['tax'] = isset($_REQUEST['cart'][0]['tax']) ? $_REQUEST['cart'][0]['tax'] : '0'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // include the cart class | |
| include("Cart.class.php"); | |
| // a new session is required before creating the cart object | |
| session_start(); | |
| // create a cart object | |
| $Cart = new Cart('cart'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Post_Test extends PHPUnit_Framework_TestCase | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Post extends Eloquent | |
| { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -w | |
| use strict; | |
| use File::Find; | |
| use Digest::MD5; | |
| my %files; | |
| my $wasted = 0; | |
| find(\&check_file, $ARGV[0] || "."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias ls='ls -la' | |
| alias nginx='/etc/init.d/nginx' | |
| alias phpfpm='/etc/init.d/php5-fpm' | |
| alias www='cd /media/psf/Home/Sites' | |
| alias sandbox='cd /media/psf/Home/Sites/Sandbox' | |
| alias backup='cd /media/psf/Home/Sites/Backup' | |
| alias rmdir='rm -rf' | |
| alias logs='cd /var/log' | |
| alias addsite='/usr/bash-scripts/addsite.sh' | |
| alias removesite='sh /usr/bash-scripts/removesite.sh' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cp $1 $1.backup | |
| vim $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| mkdir -p $1 | |
| cd $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gsub_literal() { | |
| # STR cannot be empty | |
| [[ $1 ]] || return | |
| # string manip needed to escape '\'s, so awk doesn't expand '\n' and such | |
| awk -v str="${1//\\/\\\\}" -v rep="${2//\\/\\\\}" ' | |
| # get the length of the search string | |
| BEGIN { |
NewerOlder