Skip to content

Instantly share code, notes, and snippets.

View dbrant's full-sized avatar
🍣
Kickin' it

Dmitry Brant dbrant

🍣
Kickin' it
View GitHub Profile
{
"batchcomplete": "",
"query": {
"notifications": {
"list": [
{
"wiki": "enwiki",
"id": "73770596",
"type": "edit-user-talk",
"category": "edit-user-talk",
@dbrant
dbrant / pi_gpio_sample.py
Created March 19, 2016 17:20
GPIO sample for Raspberry Pi
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(4,GPIO.OUT)
GPIO.setup(23,GPIO.OUT)
GPIO.setup(25,GPIO.OUT)
index = 0
while True:
@dbrant
dbrant / CatchNameNotFoundException.jaja
Created February 19, 2016 03:38
Sketch of catching exception when WebView is being updated.
@Override
protected void onStart() {
try {
super.onStart();
} catch (Throwable t) {
if (ThrowableUtil.throwableContainsException(t, PackageManager.NameNotFoundException.class)) {
// This can happen when the system updates the WebView component. There's a
// brief window of time when the old WebView is uninstalled from the package
// manager, and the new one is not yet installed, so it literally doesn't exist.
@dbrant
dbrant / ImagePipelineStreamGetter.java
Last active February 3, 2016 03:56
Get stream from Fresco image pipeline.
private abstract class ImagePipelineStreamGetter {
private String imageUrl;
public ImagePipelineStreamGetter(String imageUrl) {
this.imageUrl = imageUrl;
}
public abstract void onSuccess(InputStream stream);
public abstract void onError(Throwable t);
@dbrant
dbrant / symbology
Last active July 21, 2020 02:04
Useful symbols
ligature: ff fi fl ffi ffl
hyphen: ‐
non-breaking hyphen: ‑
minus sign: −
figure dash: ‒
en dash: –
em dash: —
horizontal bar: ―