Skip to content

Instantly share code, notes, and snippets.

Richard Banasiak banasiak

Block or report user

Report or block banasiak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
banasiak /
Last active Nov 23, 2019
A python script that polls the CheerLights API and sets the LEDs of a Blinkt! hat.
# curl | 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
# 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
private class DebugModeTapListener implements View.OnClickListener {
private int tapCount = 0;
private long lastTap = SystemClock.elapsedRealtime();
public void onClick(final View v) {
final Context context = getApplicationContext();
long currentTap = SystemClock.elapsedRealtime();
if (currentTap - lastTap < 500) {
banasiak / DefaultKeyBindings.dict
Last active Oct 29, 2018 — forked from Jimbly/DefaultKeyBindings.dict
Mac OSX keybindings to more closely match Windows
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
banasiak /
Created Sep 13, 2018 — forked from kenmickles/
Shell script to dynamically update a Digital Ocean DNS record
TOKEN="Get token from"
IP=`curl -s | grep -Eo '[0-9\.]+'`
# to get record id:
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "$DOMAIN/records"
echo "Formatting code..."
./gradlew googleJavaFormat formatKotlin --daemon
if [ "$status" = 0 ]; then
echo "Formatting complete - adding files to Git"
git add .
exit 0
banasiak / 10-monitor.conf
Created Mar 11, 2018
Dell XPS 15 4K Monitor Resolutions (Fedora)
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"
Section "Screen"
Identifier "Screen0"
banasiak /
Last active Mar 7, 2018
Script to send a deep link to an Android app.
banasiak /
Created Jan 16, 2018
Absolute last chance to log an exception and it's stack trace to logcat for an Android app.
public class MyApplication extends MultiDexApplication {
public void onCreate() {
if(BuildConfig.DEBUG) {
final Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
(t, e) -> {;
handler.uncaughtException(t, e);
banasiak / KotlinEchoServer.kt
Created Nov 23, 2017
An example echo server written in Kotlin.
View KotlinEchoServer.kt
import kotlin.concurrent.thread
const val SERVER_PORT = 1337
fun main(args: Array<String>) {
You can’t perform that action at this time.