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 | |
namespace Console\Uploader\Strategy; | |
use \Console\Uploader\Exception\ConnectionFailedException; | |
use \Console\Uploader\Exception\InvalidCredentialException; | |
class Sftp implements StrategyInterface | |
{ |
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
var ProbabilityQueue = (function() { | |
var obj = function() { | |
this.objects = []; | |
this.priorities = []; | |
this.max = 0; | |
this.length = 0; | |
} | |
obj.prototype.enqueue = function(chance, object) { |
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 | |
class Resolver | |
{ | |
protected $data; | |
protected $queue = []; | |
protected $loaded = []; | |
public function __construct($data) |
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
{ | |
"color_scheme": "Packages/User/Monokai (SL).tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"fallback_encoding": "UTF-8", | |
"highlight_line": true, | |
"shift_tab_unindent": true, | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": 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
<?php | |
function permutate($array) { | |
$current = array_shift($array); | |
$result = array(); | |
if ($array) { | |
foreach (permutate($array) as $permutation) { | |
foreach ($current as $value) { |
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
'use strict'; | |
var Translator = function() { | |
this.dict = 'ka,tu,mi,te,ku,lu,ji,ri,ki,zu,me,ta,rin,to,mo,no,ke,shi,ari,chi,do,ru,na,mei,fu,ra'.split(','); | |
}; | |
Translator.prototype.parse = function(str) { | |
var that = this; | |
return str.split('').reduce(function(r, c) { | |
var chr = c.toLowerCase().charCodeAt(0) - 97; |
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 | |
require_once 'Parseable.php'; | |
abstract class AbstractParser implements Parseable { | |
public function parse($str) | |
{ | |
$dict = $this->dict; | |
return array_reduce(str_split($str), function ($r, $c) use ($dict) { |
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 | |
$argc != 2 && exit('Use: php japaname.php yourname' . PHP_EOL); | |
$dict = explode(',', 'ka,tu,mi,te,ku,lu,ji,ri,ki,zu,me,ta,rin,to,mo,no,ke,shi,ari,chi,do,ru,na,mei,fu,ra'); | |
$japaname = array_reduce(str_split($argv[1]), function ($r, $c) use ($dict) { | |
$chr = ord(strtolower($c)) - 97; | |
return $r . (array_key_exists($chr, $dict) ? $dict[$chr] : ' '); | |
}); |
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 | |
class Block { | |
public $prefix; | |
public $microtime; | |
public $trash; | |
public $dificulty = 0; | |
public $hash; |