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 | |
// 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; |
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
// 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);} | |
} |
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
a { | |
-moz-transition: 0.2s color linear; | |
-webkit-transition: 0.2s color linear; | |
transition: 0.2s color linear; | |
color: #333; | |
} | |
a:hover { | |
color: #933; | |
} |
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
# 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 |
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 | |
/******************************************************************************* | |
PHP Crypt 0.1 | |
============= | |
Original Source: http://gist.github.com/165342 | |
Designed for password protection. Provides some extent of customization over |
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
# 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 |
NewerOlder