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 | |
class sortings | |
{ | |
public static function bubbleSort(array $integers) | |
{ | |
for($runTo = sizeof($integers)-1; $runTo >0; $runTo-- ) | |
{ | |
for($i = 0; $i < $runTo; $i++) | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
namespace MathWeb | |
{ | |
public partial class WebForm1 : System.Web.UI.Page |
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 | |
function getmicrotime() | |
{ | |
list($usec, $sec) = explode(" ", microtime()); | |
return ((float)$usec + (float)$sec); | |
} | |
$time_start = getmicrotime(); | |
header('Content-Type: text/html; charset=utf-8'); |
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 | |
function the_last_function() | |
{ | |
static $haltCodes = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR); | |
$error = error_get_last(); | |
if ($error && in_array($error['type'], $haltCodes)) | |
{ |
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
class RamCache | |
{ | |
private static $data = array(); | |
public static function set($key, $value) | |
{ | |
self::$data[$key] = $value; | |
} | |
public static function get($key) |
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 | |
function hybi10Encode($payload, $type = 'text', $masked = true) | |
{ | |
$frameHead = array(); | |
$frame = ''; | |
$payloadLength = strlen($payload); | |
switch($type) | |
{ |
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
// divides array into equal arrays, each of size n | |
function by(n, arr) | |
{ | |
function byby(n, arr, accum) | |
{ | |
if(arr.length < 1) return accum; | |
var head = [arr.slice(0,n)]; | |
var tail = arr.slice(n); | |
return byby(n, tail, accum.concat(head)); | |
} |
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 | |
class Node | |
{ | |
/** @var int $value - The value of the item */ | |
public $value; | |
/** @var Node $next - Reference to the next item in list */ | |
public $next; |
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
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP errors | |
* | |
*/ | |
RunPHPLoc(); |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsaUsH2NsgRDNgT5BrodagWWI1L6KUm6vap/3OPWdNKj67QzncVDsMyXLosutzldVp1GzINudY3lXPrcDErGi7kQPcwL6CcKidg2wC5/SnUU+uuhOv3jjSR6tNvegI6jpQ1HYMOGSDV6qo6wlVfcTur9dHM8ZejqMXnTJJ7MbwK1MA2CbTOx0vy/o1lax7dvicPFuioVy5J6vzDbVSW10hhhFn6RSU0bIS7c5K6PxE/uauAs2ZVc8lsiqZf7p0Mq9U6FtEdQmCOhFB8MstUe9soYLDN7rWk7TdKL1Kz/GrggCo/B2jwczPfFNrH2TUlzqP6WjItW3Db7dIhsx7Jc8R raskin@TPG_DEV_001 |
OlderNewer