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; | |
}; |
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
sudo npm i -g bower coffee-script cordova electron-packager electron-prebuilt express-generator forever grunt grunt-cli gulp static ionic jsdom-cli less mathjs q nodemon node-static ngist |
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 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 | |
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
#!/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
# 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
imports: null | |
prefix: null | |
routes: | |
home: | |
methods: | |
- get | |
- head | |
uri: "/{page}.{format}" | |
action: "Packfire\\Test\\Controller:action" | |
defaults: |
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
/** | |
* This code was extracted from https://github.com/mauris/gitguard/blob/master/src/components/FileTree/index.js | |
* Using AngularJS, this 60-LoC file forms the controller neccessary for the frontend of a file tree component | |
* to be working. | |
* | |
* Whenever a folder from the list is selected, the code will request the server for the list of files in that path. | |
*/ | |
const app = require('../../app'); | |
let $controller = function ($http, $scope) { |
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
export RUNFILE=BabyNames; javac $RUNFILE.java; for file in *.in; do java $RUNFILE < $file | diff ${file%.*}.out -; done |
OlderNewer