Richard Banasiak banasiak
- Minneapolis, MN
- Sign in to view email
- https://banasiak.com
View cheerlights.py
# curl https://get.pimoroni.com/blinkt | bash | |
import blinkt | |
import requests | |
from collections import deque | |
from requests.adapters import HTTPAdapter | |
from requests.exceptions import ConnectionError | |
from sys import exit | |
from time import sleep |
View pepperbot2.py
# pip3 install RPI.GPIO | |
# pip3 install adafruit-circuitpython-ads1x15 | |
import board | |
import busio | |
import adafruit_ads1x15.ads1115 as ADS | |
import RPi.GPIO as GPIO | |
from adafruit_ads1x15.analog_in import AnalogIn | |
from board import SCL, SDA | |
from math import floor |
View ReplaceNotepadWindows10.bat
@echo off | |
echo Create Backup copies of the original notepad.exe | |
copy C:\Windows\notepad.exe C:\Windows\notepad.exe.bak | |
copy C:\Windows\System32\notepad.exe C:\Windows\System32\notepad.exe.bak | |
copy C:\Windows\SysWOW64\notepad.exe C:\Windows\SysWOW64\notepad.exe.bak | |
echo Take Ownership of the files | |
takeown /F C:\Windows\notepad.exe /A | |
takeown /F C:\Windows\System32\notepad.exe /A | |
takeown /F C:\Windows\SysWOW64\notepad.exe /A |
View DebugModeTapListener.java
private class DebugModeTapListener implements View.OnClickListener { | |
private int tapCount = 0; | |
private long lastTap = SystemClock.elapsedRealtime(); | |
@Override | |
public void onClick(final View v) { | |
final Context context = getApplicationContext(); | |
long currentTap = SystemClock.elapsedRealtime(); | |
if (currentTap - lastTap < 500) { |
View DefaultKeyBindings.dict
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely | |
match default behavior on Windows systems. | |
You must log out and back in to see these changes. | |
Here is a rough cheatsheet for syntax. | |
Key Modifiers | |
^ : Ctrl | |
$ : Shift |
View update-digitial-ocean-dns.sh
#!/bin/bash | |
TOKEN="Get token from https://cloud.digitalocean.com/settings/applications" | |
DOMAIN=example.com | |
RECORD_ID=12345 | |
IP=`curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'` | |
# to get record id: | |
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/domains/$DOMAIN/records" |
View pre-commit.sh
#!/bin/sh | |
echo "Formatting code..." | |
./gradlew googleJavaFormat formatKotlin --daemon | |
status=$? | |
if [ "$status" = 0 ]; then | |
echo "Formatting complete - adding files to Git" | |
git add . | |
exit 0 |
View 10-monitor.conf
Section "Monitor" | |
Identifier "eDP-1" | |
Modeline "3840x2160_60.00" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync | |
Modeline "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync | |
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync | |
Option "PreferredMode" "2560x1440_60.00" | |
EndSection | |
Section "Screen" | |
Identifier "Screen0" |
View deeplink.sh
#!/bin/bash | |
adb shell am start -W \ | |
-a android.intent.action.VIEW \ | |
-d \'$1\' \ | |
com.target.ui.debug \& |
View DefaultUncaughtExceptionHandler.java
public class MyApplication extends MultiDexApplication { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
if(BuildConfig.DEBUG) { | |
final Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler(); | |
Thread.setDefaultUncaughtExceptionHandler( | |
(t, e) -> { | |
Timber.wtf(e); | |
handler.uncaughtException(t, e); |
NewerOlder