Skip to content

Instantly share code, notes, and snippets.

View 9x3l6's full-sized avatar
💭
We all learn whether we like it or not and we all get what we deserve

AG 9x3l6

💭
We all learn whether we like it or not and we all get what we deserve
  • EARTH
View GitHub Profile
'/([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})/'
@9x3l6
9x3l6 / docker-compose.yml
Created August 24, 2023 14:48
MongoDB Docker Compose
version: '3.8'
services:
mongodb:
image: mongo:6-jammy
ports:
- '27017:27017'
volumes:
- dbdata6:/data/db
networks:
- db-network
@9x3l6
9x3l6 / .bashrc
Last active August 24, 2023 01:36
YTDL function for downloading videos
function ytdl-update() {
python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz
}
function ytdl () {
local RETRIES=10 # --retries "${RETRIES}"
local LANG=en,es,de,fr,ru,uk # --sub-lang "${LANG}"
local FORMAT=best # --format "${FORMAT}"
local AGE=21 # --age-limit "${AGE}"
local SLEEP=5 # --sleep-requests "${SLEEP}"
@9x3l6
9x3l6 / README.md
Last active August 24, 2023 00:25
Substack JSON Downloader Python Script (downloads all posts and downloads images too)

SUBSTACK DOWNLOADER JSON

This code is free to use and modify by anyone who loves the truth. If you don't love the truth then you are an enemy of humanity and therefore you are suicidal and need to seek mental help for being a crazy person that hates life.

The script is kept simple for the purpose of easier updates later on. It could be OOP but what's the point, for something simple as scraping contents it's better to keep it as short as possible.

python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
@9x3l6
9x3l6 / ssdl.py
Created August 14, 2023 16:39
Substack RSS Feed Downloader Python Script (downloads images too)
#!/usr/bin/env python3
# python3 -m venv .venv
# . .venv/bin/activate
# pip3 install feedparser requests markdownify pillow gazpacho
# ./ssdl.py https://karenkingston.substack.com/feed ~/Downloads/karenkingston
import os
import argparse
import feedparser
@9x3l6
9x3l6 / smallest.go
Created July 11, 2023 01:05
Smallest number in list using golang
package main
import "fmt"
import "sort"
func main() {
a := []int{
48,96,86,68,
57,82,63,70,
37,34,83,27,
@9x3l6
9x3l6 / rangeYear.py
Last active December 27, 2022 23:32
from datetime import date
def getYearsRange(start=2019, end=date.today().year):
return [i for i in range(start, end + 1)]
def char_count(s):
d = {}
for i in s.strip():
if d.has_key(i):
d[i] += 1
else:
d[i] = 1
r = ""
for i in sorted(d.keys()):
r = "%s %s=%s" % (r, i, d[i])
#! /usr/bin/env python
import sys
"""
return if string is palindrome
"""
def palindrome(str):
_len = len(str)
if _len % 2 == 0:
if str[:_len/2] == str[_len/2:][::-1]:
return True
@9x3l6
9x3l6 / dhs-reports.py
Created December 23, 2022 17:10
Download DHS daily report PDF documents
#!/usr/bin/env python
# python dhs-report.py --start-date='2016-09-01'
import os
import sys
import argparse
import pandas as pd
from pandas.tseries.offsets import BDay # BusinessDay
from datetime import datetime
import requests