Skip to content

Instantly share code, notes, and snippets.

jerieljan /
Created May 22, 2021
Screenshot OCR with BetterTouchTool on MacOS
#!/usr/bin/env bash
# Usage:
# - Install `tesseract` with `brew install tesseract`
# - In BetterTouchTool, create a trigger of your choice.
# (I recommend a Keyboard Shortcut with Cmd+Shift 6)
# - Add an Execute Shell Script / Task action
# - Paste this script.
# NOTE: You'll need to authorize BTT to the Screen Recording permission in Security and Privacy at System Preferences
tonetheman /
Created Sep 27, 2020
find a radio button to click on
URI = ""
from selenium.webdriver import Chrome, ChromeOptions
from import expected_conditions as EC
from import WebDriverWait
from import By
TheCloudScout / dockerfile
Created Nov 4, 2019
View dockerfile
# escape=`
# Install .NET 4.8
RUN curl -fSLo dotnet-framework-installer.exe `
&& .\dotnet-framework-installer.exe /q `
&& del .\dotnet-framework-installer.exe `
&& powershell Remove-Item -Force -Recurse ${Env:TEMP}\*
nestukh /
Last active Nov 16, 2021
Install firefox-esr + geckodriver + selenium + python3 on raspberry pi 3 and above
pypcks="python3-pip python3 python3-all-dev python3-dev libffi-dev libssl-dev librtmp-dev python-dev python3 python3-doc python3-tk python3-setuptools tix xvfb python-bluez python-gobject python-dbus python cython python-doc python-tk python-numpy python-scipy python-qt4 python3-pyqt5 python3-pyqt5.q* python3-qtpy python-pyqt5.q* python-lxml fontconfig python-demjson qt5-default libqt5webkit5-dev build-essential libudev-dev python-lxml libxml2-dev libxslt-dev libpq-dev python-pyside python-distlib python-pip python-setuptools" # python-examples python3-examples python-vte
allgoodpcks="ca-certificates virtualenv autotools-dev cdbs git expect libnss3-tools util-linux xvfb curl bridge-utils chromium-browser chromium-chromedriver firefox-esrt"
sudo apt-get install --reinstall -y $pypcks $allgoodpcks
if [[ ! -f /usr/lib/chromium-browser/chromedriver ]]; then
sudo ln -s /usr/bin/chromedriver /usr/lib/chromium-browser/chromedriver
HauptJ /
Last active Nov 29, 2021
Terraform Server Resource Creation and Provisioning with Ansible
# Creates and provisions DO cloud server for WordPress
resource "digitalocean_droplet" "wordpress" {
image = "centos-7-x64"
name = "${var.do_wordpress_name}"
region = "${var.do_region}"
size = "${var.do_wordpress_size}"
ipv6 = true
monitoring = true
ssh_keys = [
ShayMe21 / MyViewController.cs
Created Jul 31, 2018
Xamarin with Auth0 and TouchID Authentication
View MyViewController.cs
using System;
using UIKit;
using Auth0.OidcClient;
using System.Text;
using LocalAuthentication;
using Foundation;
using Xamarin.Auth;
bgadrian / set.go
Last active Nov 20, 2021
How to implement a simple set data structure in golang
View set.go
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
nqbao /
Last active Dec 1, 2021
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <>
# 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:
# The above copyright notice and this permission notice shall be included in all
markekraus / GetInboxRuleReport.ps1
Last active Jan 31, 2019
Generates Multi-Threaded Office 365 Inbox Rule Report That Scales with the Number of Service Accounts Provided
View GetInboxRuleReport.ps1
using namespace System.Collections.Concurrent
$StartDate = [datetime]::UtcNow
# can be generated with something like
# 1..10 | %{ Get-Credential} | Export-CliXml -path 'C:\reports\InboxRules\Creds.xml'
# Which will prompt for credentials 10 times and store them in the xml file
$CredentialFile = 'C:\reports\InboxRules\Creds.xml'
$RunDate = $StartDate.ToString('o') -replace ':'
# This is the path of the CSV file. It is imperative that this file not be
# access while the script is running