Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile

If .DS_Store was never added to your git repository, simply add it to your .gitignore file.

If you don't have one, create a file called

.gitignore

In your the root directory of your app and simply write

@glowinthedark
glowinthedark / simple_websocket.html
Created December 6, 2024 12:54 — forked from SadatAnwar/simple_websocket.html
A working implementation of the super simple websocket python server
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@glowinthedark
glowinthedark / svg2icns.sh
Created November 16, 2024 09:59 — forked from adriansr/svg2icns.sh
Convert SVG file to macOS icon (icns) format
#!/bin/sh -x
set -e
SIZES="
16,16x16
32,16x16@2x
32,32x32
64,32x32@2x
128,128x128
@glowinthedark
glowinthedark / find-replace-in-files-regex.py
Last active November 13, 2024 15:40
Find replace in files recursively with regular expressions
#!/usr/bin/env python3
#
# Example Usage:
# -------------------------------------------------------------------------------
# modify dates from 30-10-2024 to 2024-10-30
# find-replace-in-files-regex.py -g "*.html" "(\d\d)-(\d\d)-(\d\d\d\d)" "\3-\2-\1"
# -------------------------------------------------------------------------------
import argparse
@glowinthedark
glowinthedark / getlinks.py
Last active November 7, 2024 12:24
Extract links from a URL or a local file system path
@glowinthedark
glowinthedark / countryFlagsNamesAndDialCodes.json
Created November 5, 2024 18:33 — forked from angusjf/countryFlagsNamesAndDialCodes.json
Country Emoji Flags, Names and Dial Codes JSON Mapping
{
"ad": {
"flag": "🇦🇩",
"name": "Andorra",
"dialCode": "+376"
},
"ae": {
"flag": "🇦🇪",
"name": "United Arab Emirates",
"dialCode": "+971"
@glowinthedark
glowinthedark / multiple_ssh_setting.md
Created November 1, 2024 17:34 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@glowinthedark
glowinthedark / AndroidEmulator.js
Last active October 14, 2024 06:53
run android emulator on macos
#!/usr/bin/osascript -l JavaScript
// THE SHEBANG IS ONLY NEEDED IF YOU RUN IT AS A SHELL SCRIPT
// ^^^ REMOVE THE SHEBANG LINE ABOVE IF RUNNING FROM SCRIPT EDITOR/AUTOMATOR!!!!! ^^^
// 1. In MacOS Spotlight type 'Script Editor' and paste the code below
// 2. Click the top-left dropdown which says 'AppleScript' and select 'JavaScript'
// 3. Under menu File pick Export
// 4. In the Export dialog select File Format = Application
// 5. Save the app in /Applications
@glowinthedark
glowinthedark / aliexpress_order_history_export_csv.js
Last active September 23, 2024 12:28
AliExpress Order History export to CSV
function formatCSVValue(value) {
value = String(value);
// If the value contains a comma, newline, or quote, it needs to be quoted
if (/[,\"\n]/.test(value)) {
// Escape quotes by doubling them
value = value.replace(/"/g, '""');
// Wrap the value in quotes
value = `"${value}"`;
}
@glowinthedark
glowinthedark / yt-dlp-local-m3u8-playlist-download-bullk.sh
Last active September 24, 2024 16:19
yt-dlp download from local m3u8 playlist files
#!/usr/bin/env bash
find . -iname "*.m3u*" -exec yt-dlp --enable-file-urls file://$PWD/{} \;
# same as above with subshell
find * -iname '*.m3u*' -print -exec sh -c 'yt-dlp --enable-file-urls "file://$PWD/${1}"' _ {} \;