Skip to content

Instantly share code, notes, and snippets.

Mostly on these days...

David Weinstein dweinstein

Mostly on these days...
View GitHub Profile
dweinstein / dbg.h
Created Nov 14, 2013
debug macros for C/C++ and maybe JNI android development
View dbg.h
#ifndef __dbg_h__
#define __dbg_h__
#include <stdio.h>
#include <errno.h>
#include <string.h>
// Debug tag
#define DTAG "DBG"
dweinstein /
Last active Jan 4, 2021
create git repositories and include project info for cgit


  • This script will generate a bare git repo in your current user's ${HOME} directory
  • it will query you for relevant info that the frontend (cgit) will use and dispay to users
  • it will make an initial commit to the repository
  • this is intended to be used with this project
    • basically this hosts cgit ( from a minimal python http server so you don't have to go setup lighthttp or apache.


View Dockerfile
FROM ubuntu
MAINTAINER David Weinstein <>
# install our dependencies and nodejs
RUN echo "deb precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install python-software-properties git build-essential
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
dweinstein / Data Mining
Last active Oct 19, 2020
Free Data Mining books
View Data Mining


  • An Introduction to Statistical Learning with Applications in R by James, Witten, Hastie & Tibshirani – This book is fantastic and has helped me quite a bit. It provides an overview of several methods, along with the R code for how to complete them. 426 Pages.
  • The Elements of Statistical Learning by Hastie, Tibshirani & Friedman – This is an in-depth overview of methods, complete with theory, derivations & code. I’d definitely consider this a graduate level text. I’d also consider it one of the best books available on the topic of data mining. 745 Pages.
  • A Programmer’s Guide to Data Mining by Ron Zacharski – This one is an online book, each chapter downloadable as a PDF. It’s also still in progress, with chapters being added a few times each year. Probabilistic Programming & Bayesian Methods for Hackers by Cam Davidson-Pilson – This book is absolutely fantastic. The author explains Bayesian statistics, provides several diverse examples of how to a
dweinstein / template.txt
Created Sep 5, 2012
my org-mode template for exporting to LaTeX/PDF
View template.txt
#+TITLE: Template org-mode document for export to LaTeX/PDF
#+AUTHOR: David Weinstein
#+LaTeX_HEADER: \usepackage[left=1in,top=1in,right=1in,bottom=1.5in]{geometry}
#+LaTeX_HEADER: \usepackage{palatino}
#+LaTeX_HEADER: \usepackage{fancyhdr}
#+LaTeX_HEADER: \usepackage{sectsty}
#+LaTeX_HEADER: \usepackage{engord}
#+LaTeX_HEADER: \usepackage{cite}
#+LaTeX_HEADER: \usepackage{graphicx}
dweinstein / Dockerfile-nodejs
Last active Jan 11, 2020
Install node modules before copying over your working code so that node_modules are built (and cached) before you change your service code!
View Dockerfile-nodejs
# ...
ADD package.json /tmp/package.json
RUN cd /tmp && npm install && \
mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# ...
WORKDIR /opt/app
ADD . /opt/app
View 0001-add-HID-support-to-android-gadget.patch
From c5a7d1115318bd02145a4b41109464d564b37af9 Mon Sep 17 00:00:00 2001
From: David Weinstein <>
Date: Mon, 14 Jan 2013 12:21:37 -0500
Subject: [PATCH] add HID support to android gadget.
drivers/usb/gadget/android.c | 189 ++++++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/f_hid.c | 8 +-
2 files changed, 194 insertions(+), 3 deletions(-)
View summary.txt
ispy-console 2019-08-27 10:34:23.706613-0500 OfferUp[3150:69885] TIC SSL Trust Error [79:0x1c4376c80]: 3:0
ispy-console 2019-08-27 10:34:23.707447-0500 OfferUp[3150:69885] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2019-08-27 10:34:23.707847-0500 OfferUp[3150:69885] Task <85C2A93B-4CDD-4AE5-98FA-A42808ACDCD2>.<1> HTTP load failed (error code: -1202 [3:-9813])
ispy-console 2019-08-27 10:34:23.708246-0500 OfferUp[3150:70071] Task <85C2A93B-4CDD-4AE5-98FA-A42808ACDCD2>.<1> finished with error - code: -1202
dweinstein / gist:9550105
Created Mar 14, 2014
Cached docker build
View gist:9550105
Uploading context 4.608 kB
Uploading context
Step 0 : FROM ubuntu
---> 9cd978db300e
Step 1 : MAINTAINER David Weinstein <>
---> Using cache
---> 67aeca8f12ae
Step 2 : RUN echo "deb precise main universe" > /etc/apt/sources.list
---> Using cache
---> be8f73b1204f
set -x
PROXY_HOST=$(ifconfig en0 | grep "inet " | awk '{print $2}')
function adb_shell {
local cmd="$1"
adb shell "${cmd}"