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 | |
# | |
# Configure fzf | |
# Set up fzf tab completion | |
. /usr/share/fzf/completion.bash | |
# Set up fzf key bindings | |
. /usr/share/fzf/key-bindings.bash |
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 | |
# | |
# Send or receive data to/from another device on the network. | |
PROGRAM=${0##*/} | |
LOCAL_IP=192.168.1.100 | |
PORT=6666 | |
PASSWORD=topsecret |
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 | |
# | |
# Install shellcheck | |
set -euo pipefail | |
# resynchronize the package index | |
apt-get -qq update | |
# install QEMU Linux user mode emulator (and jq) |
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
{ | |
"fallback": [ | |
{ "class_name": "com.google.android.libraries.youtube.player.background.BackgroundTransitioner", "method_name": "updateBackgroundService", "actions": [ | |
{ "name": "set_field_boolean_before_method", "field_name": "playbackModality.isInBackground", "value": true } | |
] }, | |
{ "class_name": "com.google.android.libraries.youtube.innertube.model.PlayabilityStatusModel", "method_name": "isPlayable", "actions": [ | |
{ "name": "set_field_boolean_before_method", "field_name": "isBackgroundable", "value": true } | |
] }, | |
{ "class_name": "com.google.android.apps.youtube.app.background.BackgroundSettings", "method_name": "getBackgroundAudioSetting", "actions": [ | |
{ "name": "return_string", "value": "on" } |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Sample scraper script | |
See: https://impythonist.wordpress.com/2015/01/06/ultimate-guide-for-scraping-javascript-rendered-web-pages/ | |
""" | |
# standard imports | |
import sys |
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
"""Render HTML for scraping""" | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from contextlib import contextmanager | |
from multiprocessing import Pool | |
try: | |
TimeoutError |
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
# -*- coding: utf-8 -*- | |
"""Poll websites for new entries""" | |
# standard imports | |
import itertools | |
from collections import deque | |
# external imports | |
from pickleshare import PickleShareDB |
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
# [Git] | |
_completion_loader git | |
alias g="git" | |
__git_complete g _git | |
alias ga="git add" | |
__git_complete ga _git_add | |
alias gap="git add --patch" | |
__git_complete gap _git_add | |
alias gb="git branch" | |
__git_complete gb _git_branch |
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
# Create a temporary pyenv virtualenv | |
mktempenv(){ | |
[[ $1 =~ ^(-h|--help)$ ]] && { | |
echo "Usage: ${FUNCNAME[0]} [VERSION] [NAME]" | |
echo 'Create a temporary pyenv virtualenv' | |
return 0 | |
} | |
local pyenv_version=${1:-$(pyenv version-name)} | |
local venv_name=${2:-$(mktemp --dry-run -d "tmp-$pyenv_version-XXXXXX")} |
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 | |
# | |
# Create a pdf from HTML or URL | |
cleanup(){ | |
# check whether $TEMPDIR exists and is a subdir of /tmp | |
if [[ -d $TEMPDIR && $(dirname "$TEMPDIR") = /tmp ]]; then | |
rm -rf "$TEMPDIR" | |
fi |
NewerOlder