Skip to content

Instantly share code, notes, and snippets.

View azophy's full-sized avatar
🏠
Working from home

Abdurrahman Shofy Adianto azophy

🏠
Working from home
View GitHub Profile
@azophy
azophy / urllib-http-post.py
Created May 30, 2021 17:03
Python: send HTTP POST with built-in library (urllib)
#!/env/python
# send HTTP POST with empty body
# taken from https://stackoverflow.com/a/64860348/2496217
from urllib import request
req = request.Request(
'https://postman-echo.com/post',
method='POST',
@azophy
azophy / github_stat_compare.html
Created January 12, 2021 07:26
Compare statistics for Github Repos
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Analyze Github Stats</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>
<style>
table {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
@mccabe615
mccabe615 / phpdangerousfuncs.md
Last active May 27, 2024 11:38
Dangerous PHP Functions

Command Execution

exec           - Returns last line of commands output
passthru       - Passes commands output directly to the browser
system         - Passes commands output directly to the browser and returns last line
shell_exec     - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen          - Opens read or write pipe to process of a command
proc_open      - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
@delameko
delameko / upgrade-postgres-9.5-to-9.6.md
Last active August 22, 2023 08:22 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
@mdmunir
mdmunir / Action.php
Created June 23, 2015 22:41
Menghitung waktu shalat
public function actionImsakiyah()
{
$model = new \app\models\Imsakiyah();
$jadwal = null;
if ($model->load(\Yii::$app->request->get(), '') && $model->validate()) {
$jadwal = $model->getImsakiyah();
}
return $this->render('imsakiyah', ['model' => $model, 'jadwal' => $jadwal]);
}
@andreagrandi
andreagrandi / parse_json_post.go
Created August 19, 2014 13:28
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string