Notes: Everything I Needed to Know, I Learned in Rabbinical School — Yitzchok Willroth — php[tek] 2015
php[architect]
-
Cultivate a mentor for yourself
-
Identify
# I had trouble with the player saving data from the previous turns, namely | |
# the escape route I was generating to escape from 2 or more enemies. So, | |
# I put the behavior into a Brain that is a finite state machine. It's not | |
# that great, but you can see what I've got. | |
# | |
# This guy ought to solve ruby-warrior puzzles: | |
# - intermediate-001 | |
# - intermediate-002 | |
# - intermediate-003 |
<?php | |
/******************************************************************************* | |
PHP Crypt 0.1 | |
============= | |
Original Source: http://gist.github.com/165342 | |
Designed for password protection. Provides some extent of customization over |
# Ruby translation of: http://kaioa.com/node/53#comment-477 | |
probabilities = [1, 1, 1, 1, 1, 1]; | |
unrandomness = 1; | |
def cumsum(vector) | |
_dup = vector.dup | |
1.upto(_dup.length - 1) { |i| _dup[i] += _dup[i-1] } | |
_dup | |
end |
a { | |
-moz-transition: 0.2s color linear; | |
-webkit-transition: 0.2s color linear; | |
transition: 0.2s color linear; | |
color: #333; | |
} | |
a:hover { | |
color: #933; | |
} |
// An example for: | |
// http://blog.rebeltix.com/2011/04/css-sass-and-how-to-improve-the-mess/ | |
@for $i from 1 through 6 { | |
h#{$i} {font-size: 12pt + (14 - $i*2);} | |
} | |
@for $i from 1 through 3 { | |
box-level-#{$i} {background-color: #333 + ($i * #333);} | |
} |
var http = require('http'); | |
function fib(n){ | |
if (n < 2) return 1; | |
else return fib(n-2) + fib(n-1); | |
} | |
var cached_fib = (function(){ | |
var cache = {}; | |
return function(n) { |
package main | |
import ( | |
"fmt" | |
cr "crypto/rand" | |
"os" | |
enc "encoding/ascii85" | |
"big" | |
) |
<?php | |
function print_args() { | |
foreach(func_get_args() as $value) | |
echo var_dump($value) . "\n"; | |
} | |
// This will print "int(2)" | |
print_args(extract(array('key' => 'value', "bool" => false))); |
<?php | |
// Originally by Andrew Moore | |
// Src: http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php/6337021#6337021 | |
// | |
// Heavily modified by Robert Kosek, from data at php.net/crypt | |
class Bcrypt { | |
private $rounds; | |
private $prefix; |