Skip to content

Instantly share code, notes, and snippets.

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

Chukwudi Nwachukwu ichux

🏠
Working from home
View GitHub Profile
@ichux
ichux / time_as_seen.py
Last active June 26, 2024 05:02
describe_time
from datetime import datetime
import pytz
UTC = pytz.UTC
WAT = pytz.timezone("Africa/Lagos")
def current_time():
return datetime.now(pytz.utc).strftime("%Y-%m-%d %H:%M:%S %Z%z")
from datetime import datetime
import pytz
data = {
"sub": [
["a1", "2024-07-01 07:39:41 UTC+0000"],
["a3", "2024-07-01 07:39:41 UTC+0000"],
["j5", "2024-07-01 07:39:41 UTC+0000"],
]

Full Step-by-Step Example

Let's assume the temporary branch is backup.

  1. Change the default branch to backup on GitHub:

    • Go to "Settings" -> "Branches" -> change the default branch to backup.
  2. Delete the remote main branch:

!
! Block PunchNG
!
##.ad-container
##.ad-container-inner
##div[class="ad-container"]
##div[class="ad-container-inner"]
@ichux
ichux / filter.txt
Created April 27, 2024 04:40
AdGuard custom filter rules
$127.0.0.1 analytics.google.com
||googletagmanager.com^$important
@@||nitroflare.com^
||quirkybliss.com^
||merequartz.com^
# https://fontawesome.com/v4/icons/
docker pull minlag/mermaid-cli
# Output file must end with ".md"/".markdown", ".svg", ".png" or ".pdf"
docker run --rm -u `id -u`:`id -g` -v ./onpie:/data minlag/mermaid-cli -i input.mmd
docker run --rm -u `id -u`:`id -g` -v ./onpie:/data minlag/mermaid-cli mmdc -i input.mmd -o output.png
flowchart TD
A[OneR8] -->|Call APIs| B(Analysis)
def strtobool(val):
"""Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else.
"""
val = val.lower()
if val in ('y', 'yes', 't', 'true', 'on', '1'):
return 1
# split large file into 200MB
split -b 200m artofpostgresql.zip
# bring all together
cat * > onefile.zip
@ichux
ichux / gist:236abb2b32836badc933c5174cb896d5
Created April 13, 2024 10:59
How to Run HAProxy With Docker (In-Depth Guide)
https://www.haproxy.com/blog/how-to-run-haproxy-with-docker
echo Y | docker system prune -a --volumes