Skip to content

Instantly share code, notes, and snippets.

View jason-riddle's full-sized avatar

Jason Riddle jason-riddle

View GitHub Profile
@peterwwillis
peterwwillis / cliv
Last active May 2, 2021 19:01
cliv: Command-LIne wrapper to execute different Versions of binaries in different directories using different environment variables
#!/usr/bin/env sh
# cliv - Execute commands using a specific .env and directory
set -eu
_err () { printf "%s\n" "$0: Error: $*" ; exit 1 ; }
HOME="${HOME:-$(getent passwd $(id -u) | cut -d : -f 6)}"
[ -d "$HOME/.cliv" ] || mkdir -p "$HOME/.cliv"
if [ $# -lt 1 ] || [ "$1" = "-h" ] ; then
@wlib
wlib / LICENSE
Last active June 10, 2022 22:14
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#!/bin/sh
umask 077
# File extension for the notes
note_ext="md"
fzf_opts="--height 50%"
# Preview script part of FZF.vim. Defaults to something else if not present (but
# not as fancy)
@QuynhVir
QuynhVir / filters.txt
Last active March 26, 2022 18:00
my own uBlock Origin filters
! Remove Facebook sponsored posts
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"])
facebook.com##div[role="feed"] div > span > span > a > span:upward(div[role="feed"] > div)
! Remove Facebook "Suggested for You"
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role="article"]:has(span > span > span:has-text(Suggested for You)))
! Remove Facebook "New Message"
facebook.com##span:has(div[aria-label="New Message"])
! Remove Facebook "Create Room"
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@mitchellh
mitchellh / example.nix
Created May 10, 2020 16:29
Nix function for creating a derivation (package) that installs binaries from releases.hashicorp.com
self: super: {
consul-bin = self.callPackage ./hashicorp-generic.nix {
name = "consul";
version = "1.7.3";
sha256 = "0k03n7h5h8miqhh3n3y47894vhwdcp8m611w55f826swmq9angl1";
};
# and so on...
}
@fnky
fnky / ANSI.md
Last active April 25, 2024 19:35
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@justlaputa
justlaputa / unstar-all-repos.md
Last active April 12, 2024 16:01
How to unstar all your github starred repos
@mzhukovs
mzhukovs / Chase_BankStatement_Checking_PDF_Parser.py
Created September 8, 2018 13:07
Python Script to Scrape Transaction Records from Chase Bank Checking Account Statement PDFs
import os
import argparse
import re
import csv
from datetime import datetime as dt
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LTPage, LTChar, LTAnno, LAParams, LTTextBox, LTTextLine
from pdfminer.pdfpage import PDFPage
alias -g subl=subl
PATH=$PATH:/usr/local/bin/; export PATH
export PATH=/usr/local/heroku/bin
# Exports {{{
export GITHUB_USER="yourgithubusername"
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin # Reorder PATH so local bin is first
export PATH=$PATH:$HOME/anaconda/bin
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'