Skip to content

Instantly share code, notes, and snippets.

@BDFife
BDFife / .emacs
Last active October 12, 2015 09:27
BDFife Emacs Config
; disable beeps
(setq visible-bell t)
; better switch buffer mode. just type and go
; (crtl-r moves through the buffers)
(iswitchb-mode 1)
; highlight matching parens
(show-paren-mode t)
@BDFife
BDFife / show_hide.html
Created November 27, 2012 23:53
Show/Hide CSS
<html>
<head>
<script language=javascript type='text/javascript'>
function toggle_visiblity(id) {
var e = document.getElementById(id);
if (e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
@BDFife
BDFife / monospace_test.html
Last active December 30, 2015 06:09
Test code that demonstrates iOS Monospace with Courier and Courier New
<html>
<head>
<style>
code { font-family: Courier; }
.new code { font-family: "Courier New";}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p> Courier Font:</p>
@BDFife
BDFife / gist:f8193f390c25bc0341fe
Created July 3, 2014 00:54
Python Scramble Text
#!/usr/bin/python
import sys
import random
text = sys.stdin.read()
new_text = ""
for char in text:
@BDFife
BDFife / gist:02a6c4741591255e3732
Created July 3, 2014 00:55
Python Shuffle Text
#!/usr/bin/python
import sys
import random
text = sys.stdin.read()
text = text.split()
new_text = ""
@BDFife
BDFife / config.yaml
Created June 23, 2018 02:32
config.yaml for Octoprint/Printrbot plugin development.
accessControl:
enabled: false
api:
key: <apikey>
appearance:
color: black
devel:
cache:
enabled: false
preemptive: false
@BDFife
BDFife / gist:6d1372e01dabaff5ecb1fa966d0cb3b9
Last active February 24, 2019 23:12
Printrbot Simple Pro Start gcode
(==Configuration Settings==)
G21 ;set metric mode - use mm as units
M100 ({{ysv:1000}}) ;slow y-axis homing velocity so it doesn't slam
M100 ({{4pl:0.6}}) ;this is setting the motor power level on the Extruder - motor 4 - to 60 percent
;skipping all other configuration. The stock settings should be correct
(==Home Printer==)
M100 ({{_leds:3}}) ;turn LED on, blue color
G92.1 X0 Y0 Z0 A0 B0 ;reset origin offsets on all axes -clean slate
G28.2 X0 Y0 Z0 ;home the x, y and z axes.
(==Level Bed==)
@BDFife
BDFife / gist:d44c17271687f4ef86914110f8252d63
Created December 8, 2018 19:57
Fairy Lamp Code Arduino
int redPin = 5;
int greenPin = 6;
int bluePin = 3;
int ledMax = 40;
int ledMin = 5;
//int brightness = ledMin;
//int fadeAmount = 1;
@BDFife
BDFife / gist:c9c7e0ec75358ab9a13349cf3431aa02
Created December 25, 2018 20:51
Fairy Lamp Code Arduino (v2)
int redPin = 5;
int greenPin = 6;
int bluePin = 3;
int ledMax = 10;
int ledMin = 2;
int redVal = ledMin;
int greenVal = ledMin;