Skip to content

Instantly share code, notes, and snippets.

kickin' it

Dmitry Brant dbrant

kickin' it
Block or report user

Report or block dbrant

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
dbrant /
Created Jan 8, 2020
Upload a list of files to Google Drive
import os
import sys
import pickle
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
directoryIndexMap = {}
dbrant /
Created Jan 8, 2020
Send email via python
import smtplib
server = smtplib.SMTP("", 587)
server.login("", password)
msg = "To:\n"
msg += "From:\n"
msg += "Subject: "
dbrant / arcDestruct.bat
Last active May 22, 2019
Windows Batch file for auto-extracting ARC archives into their own directory.
View arcDestruct.bat
REM You can put this batch file on your Desktop, and drag-and-drop ARC files into it!
REM It will automatically create a folder with the same name as the ARC file, extract the files into it, and delete the original ARC file.
mkdir "%~p1\%~n1"
move %1 "%~p1\%~n1"
cd "%~p1\%~n1"
E:\cygwin\bin\arc.exe x "%~p1\%~n1\%~n1.arc"
del "%~p1\%~n1\%~n1.arc"
View gist:4f4fd6b9e5f1a521a902092bb3c24e7a
"batchcomplete": "",
"query": {
"notifications": {
"list": [
"wiki": "enwiki",
"id": "73770596",
"type": "edit-user-talk",
"category": "edit-user-talk",
dbrant /
Created Mar 19, 2016
GPIO sample for Raspberry Pi
import RPi.GPIO as GPIO
import time
index = 0
while True:
dbrant / CatchNameNotFoundException.jaja
Created Feb 19, 2016
Sketch of catching exception when WebView is being updated.
View CatchNameNotFoundException.jaja
protected void onStart() {
try {
} 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 /
Last active Feb 3, 2016
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 / symbology
Last active Dec 28, 2015
Useful symbols
View symbology
ligature: ff fi fl ffi ffl
hyphen: ‐
non-breaking hyphen: ‑
minus sign: −
figure dash: ‒
en dash: –
em dash: —
horizontal bar: ―
You can’t perform that action at this time.