This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://x.com/settings/your_twitter_data/twitter_interests | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
Array.from( | |
document.querySelectorAll('input') | |
).filter((x) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Copyright (C) 2024 Luis López <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# shellcheck disable=SC2034 | |
__FILE__="$(realpath -- "${BASH_SOURCE[0]}")" | |
__DIR__="$(dirname -- "$__FILE__")" | |
__NAME__="$(basename -- "$__FILE__")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def is_utf_8(s): | |
try: | |
return s.encode("utf-8").decode("utf-8") == s | |
except (UnicodeEncodeError, UnicodeDecodeError): | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
YT_VIDEO="https://www.youtube.com/watch?v=ydYDqZQpim8" | |
YT_URL="$(youtube-dl --get-url "$YT_VIDEO")" | |
OUTF="$HOME/.local/share/namibia/background.png" | |
mkdir -p "$(dirname -- "$OUTF")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import logging | |
import subprocess | |
from pprint import pprint as pp | |
import boto3 | |
logging.basicConfig() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
### Bash Environment Setup | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html | |
# set -o xtrace | |
set -o errexit | |
set -o errtrace | |
set -o nounset | |
set -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gi | |
gi.require_version('Gst', '1.0') | |
gi.require_version('Gtk', '3.0') | |
gi.require_version('GLib', '2.0') | |
import os | |
from urllib import parse | |
from gi.repository import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import audioop | |
import time | |
import pyaudio | |
from typing import List | |
class settings: | |
FORMAT = pyaudio.paInt16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function color_get_ps1 { | |
local hostname="${1:-$(hostname)}" | |
hostname="${hostname/.*/}" | |
if [[ "$(uname -s)" == "Darwin" ]] | |
then | |
hashfunc=$(type -p md5) | |
else | |
hashfunc=$(type -p md5sum) |
NewerOlder