Skip to content

Instantly share code, notes, and snippets.

View bhrdn's full-sized avatar

bhrdn

View GitHub Profile
<?php
global $a, $b;
list($foo, $bar) = [
[1, 2, 9, 9, 9, 9],
[6, 5, 4, 3, 2, 7],
];
foreach (range(0, count($foo) - 1) as $x => $y) {
((($foo[$x] <=> $bar[$x]) > 0) ? $a++ : $b++); // (foo[index] - bar[index]) || if (foo > 0) then a++ or b++
@bhrdn
bhrdn / async looping
Created June 27, 2018 12:45
composer require amphp/amp
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Amp\Delayed;
use Amp\Loop;
use function Amp\asyncCall as u;
list($counter, $delay) = [10, 2000];
u(function () use ($counter, $delay) {
for ($i = 1; $i <= $counter; $i++) {
from bs4 import BeautifulSoup as bs
import random, json, sys, re, requests as r
def send(payload):
s = r.Session()
datas = bs(s.get('http://challshl.com/').text, 'html.parser')
token = datas.find_all('input', {
'name' : 'cans_token'
})[0]['value']
#!/usr/bin/python
(lambda _, __, ___, ____, _____, ______, _______, ________:
getattr(
__import__(True.__class__.__name__[_] + [].__class__.__name__[__]),
().__class__.__eq__.__class__.__name__[:__] +
().__iter__().__class__.__name__[_____:________]
)(
_, (lambda _, __, ___: _(_, __, ___))(
lambda _, __, ___:
from string import ascii_lowercase as u
import string
with open('secret.txt') as f:
datas = f.read().splitlines()
datas = {
'plain': datas[0],
'key': map(lambda x: -int(x), datas[1].split(','))
}
{
"mahasiswa": [
"nim",
"nama",
"alamat",
"ipk"
],
"matakuliah": [
"kode",
"nama",