Skip to content

Instantly share code, notes, and snippets.

View ammarfaizi2's full-sized avatar
๐Ÿ€
Baby Opossum Posse

Ammar Faizi ammarfaizi2

๐Ÿ€
Baby Opossum Posse
View GitHub Profile
Recently, I saw an announcement that the mobile network in Bali will
be shut down during Nyepi.
What will happen to the servers in a data center in Bali?
Will they also go offline?
ChatGPT's response:
from matplotlib.ticker import ScalarFormatter
import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
import pandas as pd
from email.utils import format_datetime
from datetime import datetime, timezone, timedelta
import matplotlib.dates as mdates
import matplotlib.font_manager as fm
import requests
<?php
const MAIL_LOG_PATH = __DIR__."/users/ubuntu/gwmail/storage/gwmail-master/var/log/mail.log";
const BAN_LIST_PATH = __DIR__."/storage/mail_ip_ban_list.txt";
const IPSET_PATH = "/usr/sbin/ipset";
const FAIL_THRESHOLD = 200;
const CHECK_INTERVAL_SECS = 120;
const CIDR_PRECISION = 24;
function grab_ban_list_map(string $path): array
#!/usr/bin/env php
<?php
// SPDX-License-Identifier: GPL-2.0-only
const LOCK_FILE = "/tmp/public_inbox.lock";
function clean_header_val(string $str): string
{
$ex = explode("\n", $str);
foreach ($ex as &$v)
<?php
const DB_HOST = "1.1.1.1";
const DB_USER = "1";
const DB_PASS = "1";
const DB_PORT = 3306;
const DB_NAME = "00002_indihome";
$g_user_hashtable = [];
<?php
const DB_HOST = "1.1.1.1";
const DB_USER = "root";
const DB_PASS = "???";
const DB_PORT = 3306;
const DB_NAME = "00002_indihome";
function pdo(): PDO
{
<?php
function gen_grid(float $total_value, float $total_amount,
int $nr_sell_grid, float $sell_percent_interval,
float $sell_percent_init_margin,
float $total_prep_value, int $nr_buy_grid,
float $buy_percent_interval, float $buy_percent_init_margin)
{
$sell_lines = [];
$avg_price = $total_value / $total_amount;
<center>
<div class="ib-station-name"><div style="display:inline" class="fn org"><span style="display:inline-block; position:relative; vertical-align:middle; border:6.25px solid #009BBF; border-radius:50%; margin:1px; height:37.5px; width:37.5px; line-height:100%; background:white; font-size:18.75px"><span style="position:absolute; left:0; width:37.5px; text-align:center; font-weight:bold; color:black; top:1px; height:16px; line-height:16px; font-size:16px;">T</span><span style="position:absolute; bottom:2.5px; left:0; height:19px; width:37.5px; line-height:19px; text-align:center; font-weight:bold; font-size:19px; color:black;">09</span></span> <span style="display:inline-block; position:relative; vertical-align:middle; border:6.25px solid #F62E36; border-radius:50%; margin:1px; height:37.5px; width:37.5px; line-height:100%; background:white; font-size:18.75px"><span style="position:absolute; left:0; width:37.5px; text-align:center; font-weight:bold; color:black; top:1px; height:16px; line-height:16px; font
let rdx = document.getElementById('rdx');
let c = rdx.children;
let arr = [];
for (i of c) {
let x = i.children;
if (x.length < 4)
continue;
if (!x[0].innerText || !x[1].innerText || !x[2].innerText)
continue;
// SPDX-License-Identifier: GPL-2.0-only
/*
* Simple CRUD with x86-64 Assembly (System V ABI).
*/
#define MAX_INPUT_LEN 255
#define SEEK_END 2
/*
* The struct stored in the DB looks like this: