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 -a | |
Interactive shell | |
php > class Lol { } | |
php > $a = new Lol; | |
php > var_dump($a); | |
object(Lol)#1 (0) { | |
} | |
php > $b = new 'Lol'; | |
PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in php shell code on line 1 |
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
def prettyfy(o, level=''): | |
nextlevel = level + ' ' | |
if isinstance(o, dict): | |
return '{\n' + ',\n'.join(['{}{!s}: {}'.format(nextlevel, k, prettyfy(v, nextlevel)) for k, v in o.iteritems()]) + '\n' + level + '}' | |
elif isinstance(o, list): | |
return '[\n' + ',\n'.join(['{}{}'.format(nextlevel, prettyfy(v, nextlevel)) for v in iter(o)]) + '\n' + level + ']' | |
elif isinstance(o, set): | |
return '{\n' + ',\n'.join(['{}{}'.format(nextlevel, prettyfy(v, nextlevel)) for v in iter(o)]) + '\n' + level + '}' | |
elif isinstance(o, tuple): | |
return '(\n' + ',\n'.join(['{}{}'.format(nextlevel, prettyfy(v, nextlevel)) for v in iter(o)]) + '\n' + level + ')' |
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 foo(subs, sel, act) | |
local data = {"some", "random", "junk"} | |
for z, i in ipairs(sel) do | |
local l = subs[i] | |
l.extra.stuff = luabins.save(data) | |
subs[i] = l | |
end | |
for z, i in ipairs(sel) do | |
local l = subs[i] | |
local success, thedata = luabins.load(l.extra.stuff) |
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
from struct import Struct | |
import sys | |
from collections import namedtuple | |
import codecs | |
def pick_header_codec(cpn): | |
return codecs.getdecoder(cpn) | |
class iso6937codec: | |
# Not a complete implementation, just good enough for basic testing |
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
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$username = stripslashes($username); | |
$username = mysqli_real_escape_string($db, $username); | |
$sql = "SELECT * FROM users WHERE username='$username'"; | |
$res = mysqli_query($db, $sql) or die(mysqli_error($db)); | |
if (mysqli_num_rows($res) > 0) | |
{ | |
$row = mysqli_fetch_assoc($res); | |
$hash = $row['password']; |