Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am johnbintz on github.
  • I am johnbintz (https://keybase.io/johnbintz) on keybase.
  • I have a public key ASDiWYO6ih4lqd4TXhjqx5tDmR_54FfrB7nELTb7dWKiZQo

To claim this, I am signing this object:

@johnbintz
johnbintz / mp-select-mini-notes.md
Last active Feb 27, 2021
Monoprice Select Mini 3D Printer (and general 3D printing stuff) Notes
View mp-select-mini-notes.md

(all subject to change!)

Filaments tried

ProtoParadigm

  • PLA white, black, sapphire: Sapphire was tricky to get into Bowden tube at first, but once in, all three printed fine.
  • PLA summer colors: easy to use, cheap for a lot of different colors

Hatchbox

@johnbintz
johnbintz / slicer.scad
Last active Sep 16, 2016
How I sliced up the Caverna Storage Solution for the Monoprice Select Mini 3D
View slicer.scad
// set max print size here
slice_x = 80;
slice_y = 80;
slice_z = 80;
// use like this:
//
// for y in 0 1 2 3; do for x in 0 1 2 3; do openscad -o "bottom_${x}x${y}.stl" --render -D x=$x -D y=$y bottom_slicer.scad ; done; done
//
// you may need to mess with the orientation of the imported file/slicer cube!
@johnbintz
johnbintz / create-xml.clj
Created Nov 25, 2015
Go back to the early 2000s and make a DVD of videos!
View create-xml.clj
#_(defdeps [[org.clojure/clojure "1.7.0"]
[org.clojure/data.xml "0.0.8"]])
(ns create-xml
(:require [clojure.string :as str])
(:use [clojure.data.xml]))
(def directory (clojure.java.io/file "."))
(defn get-extension [file]
@johnbintz
johnbintz / setup.sh
Created Nov 13, 2015
squid-deb-proxy for docker, because bandwidth is a thing
View setup.sh
#!/bin/bash
docker run -it --name squid-deb-proxy-cache -v /var/cache/squid-deb-proxy busybox true
docker run -d --restart=always --name squid-deb-proxy --volumes-from squid-deb-proxy-cache -p 0.0.0.0:48000:8000 pmoust/squid-deb-proxy
@johnbintz
johnbintz / webpack-watch.js
Created Sep 15, 2015
Webpack + Babel with React Native Android, using react-native-webpack-server's internals
View webpack-watch.js
// this is a hack until react-native-webpack-server gets updated (and I'm
// sure it will soon. :) )
//
// you'll need 0.4.0-rc or better of react-native-webpack-server
// don't run react-native-webpack-server's server for now, use react-native's
//
// also, run me in pure node and not babel-node, or react-native will try and
// load polyfills that are already loaded. :/
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');
@johnbintz
johnbintz / simple-capistrano-docker-deploy.rb
Last active Aug 21, 2020
Simple Capistrano deploy for a Docker-managed app
View simple-capistrano-docker-deploy.rb
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@johnbintz
johnbintz / join_kickstarter_exports.rb
Last active Aug 29, 2015
Join Kickstarter CSV files for shipping purposes
View join_kickstarter_exports.rb
require 'csv'
fields_to_keep = [
"Backer Id", "Pledge Amount", "Shipping Name", "Shipping Address 1",
"Shipping Address 2", "Shipping City", "Shipping State", "Shipping Postal Code",
"Shipping Country Name"
]
sort_result_on = "Backer Id"
View clj-into-js.clj
(defn- map-names [items]
(into {} (mapv (fn [item] {(item :name) item}) items))
)
(defn- reset-objects! [objects mapped-clj-objects]
(.forEach objects
(fn [object]
; the objects in these happen to be indexed by object.name
(let [clj-object (mapped-clj-objects (.-name object))]
(doseq [[k v] clj-object]
@johnbintz
johnbintz / board.cljs
Created Apr 13, 2014
Board directive for Can't Catch Me, Olivia!
View board.cljs
(def.directive cant_catch_me_olivia.board []
(obj :restrict "E"
:replace true
:templateUrl "partials/board.html"
:link (fn [scope element attrs]
(let [board (.find element ".board")
cells (atom [])
each-span (fn [code] (doseq [data @cells] (apply code data)))]
(doseq [y (range 0 5)]
(let [row (js/$ "<li class='row'><ol class='board-row'></ol></li>")