Skip to content

Instantly share code, notes, and snippets.

View williamwebb's full-sized avatar

William Webb williamwebb

View GitHub Profile
@williamwebb
williamwebb / DataBindingAdapter.java
Last active February 8, 2016 21:41
RecycleView adapter for use with Android's DataBinding plugin.
package io.jug6ernaut.fln2.views;
import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.AnyRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.LayoutInflater;
@williamwebb
williamwebb / BindingRecyclerView.java
Last active January 20, 2023 13:05
RecyclerView & Adapter init in XML
We couldn’t find that file to show.
@williamwebb
williamwebb / RxFirebase.java
Last active April 3, 2016 02:56 — forked from gsoltis/RxFirebase.java
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.*;
import com.firebase.client.core.view.Event.EventType;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
# lifted cool stuff from:
# https://github.com/fish-shell/fish-shell/blob/master/share/functions/fish_prompt.fish
# https://github.com/fish-shell/fish-shell/blob/master/share/tools/web_config/sample_prompts/robbyrussell.fish
function fish_prompt
# define git functions if not already defined
if not set -q -g __fish_git_functions_defined
set -g __fish_git_functions_defined
function _git_branch_name
@williamwebb
williamwebb / DeckStringDecoder.kt
Created June 3, 2017 15:53
kotlin implementation to read Hearthstone Deck Strings
typealias Cards = Map<Int, Int>
data class Deck(val version: Int, val format: Int, val cards: Cards, val heros: List<Int>)
fun ByteArrayInputStream.readVarInt() = getVarInt(this)
fun decodeDeckString(deckString: String): Deck {
val bytes = Base64.decodeBase64(deckString)
val byteStream = ByteArrayInputStream(bytes)
@williamwebb
williamwebb / End G-code
Last active October 20, 2022 12:41
Start/End G-code to support BLTouch probing
;
; end_gcode
G92 E0 ; zero the extruded length
G1 E-5 F9000 ; retract
M104 S0 ; turn off temperature
M140 S0 ; turn off bed
G91 ; relative positioning
G1 E-1 F300 ; retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+20 E-5 X-20 Y-20 F7200 ; move Z up a bit and retract filament even more
G1 X320 Y150 F10000 ; move right mid
@williamwebb
williamwebb / docker-compose.yml
Created February 10, 2020 04:01
pihole cloudflared traefik
version: "3"
services:
traefik:
container_name: traefik
domainname: homedomain.lan
image: traefik:1.7
restart: unless-stopped
# Note I opt to whitelist certain apps for exposure to traefik instead of auto discovery