This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
function autoloader($class) | |
{ | |
include_once 'classes/' . strtolower($class) . '.php'; | |
} | |
spl_autoload_register(autoloader); | |
// http://goo.gl/8xmrcx | |
// http://goo.gl/bHXxrX |
This file contains 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
# ------------------------------------------------------------------ | |
echo '--- check 1 ---------------------------------------' . "\n"; | |
# DEBUG ------------------------------------------------------------ | |
var_dump($something); | |
# ------------------------------------------------------------------ | |
echo '---------------------------------------------------' . "\n"; | |
# ------------------------------------------------------------------ |
This file contains 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
/** | |
* Write a line to a log file | |
* | |
* @param string $log destination of log file | |
* @param string $message message to log | |
* @return void | |
*/ | |
function writeLog( $log , $message ) { | |
if (! file_exists( $log ) ) { |
This file contains 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
ini_set('display_errors', 'On'); | |
error_reporting(E_ALL | E_STRICT); |
This file contains 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
// Array with the Teacher class's data | $teacher is the class instantiated | |
$teacher_Data = #array( | |
[ | |
'user_id' => $teacher->user_id, | |
'user_type' => $teacher->user_type, | |
'name' => $teacher->first_name . ' ' . $teacher->last_name, | |
'email_address' => $teacher->email_address | |
]; #); |
This file contains 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 | |
// —————————————————————————————————————————————————————————————————————————— | |
# Just a PHP file to put on your local server (as I don't have enough memory) | |
$indicesServer = array('PHP_SELF', | |
'argv', | |
'argc', | |
'GATEWAY_INTERFACE', | |
'SERVER_ADDR', | |
'SERVER_NAME', |
This file contains 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 | |
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the | |
// Mountain Standard Time (MST) Time Zone | |
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm | |
$today = date("m.d.y"); // 03.10.01 | |
$today = date("j, n, Y"); // 10, 3, 2001 | |
$today = date("Ymd"); // 20010310 | |
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01 | |
$today = date('\i\t \i\s \t\h\e jS \d\a\y.'); // it is the 10th day. |
This file contains 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 | |
/** | |
* dbug (mixed $expression [, mixed $expression [, $... ]]) | |
* Author : dcz | |
* Feel free to use as you wish at your own risk ;-) | |
*/ | |
function dbug() { | |
static $output = '', $doc_root; | |
$args = func_get_args(); | |
if (!empty($args) && $args[0] === 'print') { |
This file contains 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
display dialog "my variable: " & myVar |
OlderNewer