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 ValueHelper | |
| { | |
| /** | |
| * Construct method | |
| * | |
| * @param mixed $value | |
| */ | |
| public function __construct($value) |
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 | |
| function countBy($x = 1, $to = 100) | |
| { | |
| return range(0, $to, $x); | |
| } | |
| function countOccuranceOf($value, $array) | |
| { | |
| $counts = array_count_values($array); |
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
| require 'test/unit' | |
| class TestInstanceOf < Test::Unit::TestCase | |
| def test_string_is_a_string | |
| assert "string".is_a? String | |
| end | |
| def test_string_instance_of_string | |
| assert "string".instance_of? String |
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 | |
| namespace NoCrupht; | |
| class Router | |
| { | |
| /** | |
| * Holds array of routes | |
| * | |
| * @var array |
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 | |
| // get a user | |
| $user = Sqlph::select('user') | |
| ->where('username')->equals($username) | |
| ->and('password')->equals($password) | |
| ->limit(1) | |
| ->fetch(); | |
| echo sprintf('Hello, %s!', $user->username); // access this way? |
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
| ################################################### | |
| # WHITELISTED FILES | |
| # | |
| # Because we found so much garbage in here | |
| # that we cannot tell what is important, and | |
| # because we don't want to track garbage, we | |
| # have the `include_log.php` script automatically | |
| # append included files here. | |
| # | |
| # DO NOT EDIT BELOW -- Put custom .gitignores above |
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 | |
| /** | |
| * Decomposes a bitmask value into bitmask components | |
| * | |
| * @param int $value The bitmask value to decompose | |
| * @param array $bitmasks An array of possible bitmask components | |
| * | |
| * @return array | |
| */ |
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 | |
| /** | |
| * Database | |
| * | |
| * Simple database class wrapped around MySQL PDO object | |
| */ | |
| class Database | |
| { | |
| /** |
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 | |
| /** | |
| * Dumps a value with the file and line number where dump was called | |
| * | |
| * @params mixed $value Value to dump | |
| * @params mixed $dumpFunction The function name or closure used to dump the value. Default to var_dump() | |
| */ | |
| function dump($value, $dumpFunction = 'var_dump') { | |
| $trace = array_shift(debug_backtrace()); |
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 Color | |
| { | |
| protected static $fgColors = array( | |
| 'black' => "\033[0;30m", | |
| 'darkGray' => "\033[1;30m", | |
| 'red' => "\033[0;31m", | |
| 'lightRed' => "\033[1;31m", | |
| 'green' => "\033[0;32m", |