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
{ | |
"canon_url": "https:\/\/bitbucket.org", | |
"commits": [ | |
{ | |
"author": "mauris", | |
"branch": "master", | |
"files": [ | |
{ | |
"file": "test", | |
"type": "added" |
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
# bootstrap | |
mkdir ~/.ssh | |
cd ~/.ssh | |
# create authorized_keys file | |
touch authorized_keys | |
# at this step, add authorized keys into the touch | |
# prepare file permissions | |
chmod 700 ~/.ssh/ |
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/env php | |
<?php | |
if($argc > 1){ | |
chdir($argv[1]); | |
} | |
echo "Test Agent\n"; | |
echo "Updating repository..."; | |
exec('git pull --quiet'); |
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 prng01($min = null, $max = null){ | |
if($min === null){ | |
$min = 0; | |
} | |
if($max === null){ | |
$max = PHP_INT_MAX; | |
} | |
static $seed = 3; |
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 randomColor($id){ | |
$rawR = mt_rand(0, 10) * 25.5; | |
$rawG = mt_rand(0, 10) * 25.5; | |
$rawB = mt_rand(0, 10) * 25.5; | |
$mix = ceil(($id % 5) / 5 * 255); | |
$r = ceil(($rawR + $mix) % 255); | |
$g = ceil(($rawG + $mix) % 255); | |
$b = ceil(($rawB + $mix) % 255); | |
return str_pad(dechex(($r << 16) | ($g << 8) | $b), 6, '0', STR_PAD_LEFT); |
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 | |
$randomValue = mt_rand(); | |
$even = $randomValue & ~1; | |
$odd = $randomValue | 1; | |
// magical unicorn isn't it? |
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 op($d){ | |
return $d; | |
} | |
$ok = true; | |
$ok &= op(true); | |
$ok &= op(true); |
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 hash32shiftmult($key){ | |
$seed = 0x27d4eb2d; // a prime or an odd constant | |
$key = ($key ^ 61) ^ ($key >> 16); | |
$key = $key + ($key << 3); | |
$key = $key ^ ($key >> 4); | |
$key *= $seed; | |
$key = $key ^ ($key >> 15); | |
return $key; | |
}; |
NewerOlder