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 | |
$image = file_get_contents('http://example.com/image.jpg'); | |
$fp = fopen('image.jpg', 'w'); | |
fputs($fp, $image); | |
fclose($fp); | |
?> |
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 | |
$question = 'Why isn\'t anybody asking questions!?'; | |
$causes = array('it\'s late', 'we talk too much and scare them', 'somebody just asked one', '42'); | |
if ($this->destination == 'Jmz') { | |
echo 'A mystic error occurred! Please try-again!'."\n"; | |
exit(); | |
} | |
$n = rand(0, count($causes)-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
unsigned int z = 1023; | |
unsigned int x = 1024; | |
unsigned int test,i; | |
/* test A */ | |
double a = get_time(); | |
for(i=0; i<1000000000; i++) { | |
test = 99999; | |
test &= z; | |
} |
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 | |
$POPULATION = array(); //population of individuals | |
$POPULATION_SIZE = 100; | |
$DNA_SIZE = 12; | |
$GEN_COUNT = 1; | |
$TEST_COUNT = 0; | |
genInitPopulation(); | |
while (true) { | |
naturalSelection(); |
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 | |
include('g2w.php'); | |
$initkey = 'PEHMPSDNLXIOG65R'; // set the inital key or use generate_secret_key() for a new one | |
$timestamp = G2W::get_timestamp(); | |
$secretkey = G2W::base32_decode($initkey); // decode it into binary | |
$otp = G2W::oath_hotp($secretkey, $timestamp); // get current token | |
echo 'Init key: '.$initkey."\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
Temporary |
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 | |
//============= PARAMS ============== | |
$teacher = 'EMP000061'; //test teacher, can also be empty | |
$teacher = ''; | |
$student = 'STU000545'; //test student, CANNOT be empty | |
//============= SQL QUERY ================ | |
$query = ' | |
SELECT | |
ra.assessment, |
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
switch (test_no) { | |
case 1: return gr; | |
case 2: return gr | eq; | |
case 3: return less; | |
case 4: return less | eq; | |
case 5: return eq; | |
case 6: return !eq; | |
} |
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 | |
function prettyPrintSQLResult($result) { | |
$i=0; | |
echo '<table border="1">'; | |
while ($data = $result->fetch_assoc()) { | |
if (!$i) { | |
//first entry | |
$columns = array_keys($data); | |
echo '<tr>'; | |
foreach($columns as $c) { |
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
urxvt*font: xft:terminus:pixelsize=8 | |
urxvt*boldFont: xft:terminus:pixelsize=8 | |
urxvt*termName: rxvt | |
urxvt*background: #212629 | |
urxvt*foreground: #737c80 | |
urxvt*scrollBar: false | |
urxvt*matcher.button: 1 | |
urxvt*cursorBlink: true | |
urxvt*cursorColor: #c1c8c9 | |
urxvt*colorBD: #9a7b88 |