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
class ConcreteKlass | |
def self.new() | |
return [] | |
end | |
end | |
obj = ConcreteKlass.new | |
print obj.inspect #WHY? WHYYY? Hey, let's instantiate new ConcreteKlass, now, it's an array? WTF! |
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 | |
echo "\n--------------------------------------------------------------------------------------------------\n"; | |
echo "| Git cherry-pick tool |"; | |
echo "\n--------------------------------------------------------------------------------------------------\n"; | |
if (empty($argv[1]) || empty($argv[2])) { | |
die("Usage: php pick.php [/git/repo/path] [hash]\n"); | |
} |
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 | |
//src/WsChatter/Chat.php | |
namespace WsChatter; | |
use Ratchet\MessageComponentInterface; | |
use Ratchet\ConnectionInterface; | |
class Chat implements MessageComponentInterface { | |
protected $clients; | |
public function __construct() { |
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 | |
namespace Model; | |
use PHPFluent\JSONSerializer\Serializer; | |
class Cliente extends Serializer | |
{ | |
/** | |
* @PHPFluent\JSONSerializer\Attribute | |
*/ |
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
#!/bin/bash | |
JSLINT="jslint --indent 4 --white true" | |
for file in $(git status | grep -P '\.((js)|(html)|(json))$'); do | |
if node $JSLINT $file 2>&1 | grep 'No errors found' ; then | |
echo "jslint passed ${file}" | |
exit 0 | |
else | |
node $JSLINT $file |
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 | |
class Db | |
{ | |
private $pdo; | |
protected $table; | |
public function __construct() | |
{ | |
$parameters = json_decode(file_get_contents('config.json')); |
NewerOlder