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 shutdown_function() | |
| { | |
| $error = error_get_last(); | |
| if (is_array($error) && isset($error['type']) == false) | |
| return; | |
| switch($error['type']) | |
| { |
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
| function bashrc() { | |
| # If $script variable exists, use it as filename to append. If not, use $1 | |
| if [ -z "$script" ] | |
| then fname="$1" | |
| else fname="$script" | |
| fi | |
| if [ -z "$fname" ] | |
| then return 1 | |
| fi |
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 | |
| /** | |
| * Test Stomp Throughput | |
| * @author Shane Harter | |
| */ | |
| require 'stomp/Stomp.php'; | |
| $start = microtime(true); |
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
| import requests | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| API = "api.github.com" | |
| TOKEN = "" | |
| WHITELIST = './whitelist' | |
| EMAIL_LIST = ['sharter@trulia.com'] | |
| SMTP_SERVER = 'mail.trulia.com' | |
| def uri(uri): |
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
| for ($i=1; $i<101; $i++) { | |
| progress($i, 100, 'Percent Complete: '); | |
| usleep(25000); | |
| } | |
| function progress ($step_x, $of_y, $label = '') { | |
| $p = number_format($step_x / $of_y * 100, 1) . '%'; | |
| $p = str_pad($p, 5, ' ', STR_PAD_LEFT); | |
| if ($label) | |
| $p = "{$label} {$p}"; |
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
| Object.defineProperty(Object.prototype, 'tap', { | |
| value: function(fun){ | |
| fun.call( this ); | |
| return this; | |
| }, | |
| enumerable: false | |
| }); | |
| // Usage: | |
| // a = []; |
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 | |
| ini_set('display_errors', 1); | |
| require_once 'include/local.conf'; | |
| require_once (COMMON_INCLUDE_PATH.'email/EmailTypes.php'); | |
| $mutex = sem_get(ftok(__file__, 'D'), 1, 0666, 1); | |
| register_shutdown_function(function() use($mutex) { | |
| @sem_release($mutex); | |
| }); |
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/php | |
| <?php | |
| ini_set('memory_limit', '256M'); | |
| set_time_limit(0); | |
| require_once('include/local.conf'); | |
| require_once(COMMON_INCLUDE_PATH . 'db_mysql.class.php'); | |
| $ymds = array(20130107, 20130108, 20130109, 20130110, 20130111, 20130112, 20130113, 20130114, 20130115, 20130116, |
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
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| const min_delta = 0.000000000001 | |
| func Sqrt(x float64) float64 { |
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 | |
| $namespaces = array( | |
| 'Sheldon\examples\SignalConsole\*' => __DIR__, | |
| 'Sheldon\*' => dirname(dirname(__DIR__)) . '/src/', | |
| ); | |
| spl_autoload_register(function ($class) use ($namespaces) { | |
| $NAMESPACE_SEPARATOR = '\\'; |
OlderNewer