Skip to content

Instantly share code, notes, and snippets.

View dkgrieshammer's full-sized avatar
🎯
Focusing

David Grieshammer dkgrieshammer

🎯
Focusing
View GitHub Profile
@dkgrieshammer
dkgrieshammer / Gravity.pde
Created November 8, 2013 15:11
Processing: Example for Gravity
Node[] myNode = new Node[20];
void setup(){
size(1024, 600);
for (int i = 0; i<20; i++){
myNode[i] = new Node(random(10, 20));
}
// myNode = new Node(20);
}
@dkgrieshammer
dkgrieshammer / App.js
Created November 26, 2013 15:47
Backbone: rawTemplate
(function() {
window.App = {
Models: {},
Collections: {},
Views: {}
};
window.template = function(id) {
return _.template( $('#' + id).html() );
@dkgrieshammer
dkgrieshammer / toc.css
Created July 18, 2015 12:55
CSS Table of contents
/*------------------------------------------------------------------
[Table of contents]
1. Body & General Tags
2. Header / #header
3. Navigation / #navbar
4. Content / #content
5. Left column / #leftcolumn
6. Right column / #rightcolumn
7. Sidebar / #sidebar
/**
* Awesome website
* @author YOUR_NAME_HERE
* @version 0.1
*/
/* ============================ RESET ============================ */
/* ===== Eric Meyer Reset ===== */
@dkgrieshammer
dkgrieshammer / evernote_tags_to_lowercase.applescript
Last active January 4, 2018 12:59
Applescript to convert all your Evernote tags to lowercase (tested on osx)
tell application "Evernote"
try
-- Get list of Tags
set theTags to tags
repeat with theTag in theTags
set tagName to name of theTag
try
set lowerCaseString to do shell script "echo " & tagName & " | tr '[:upper:]' '[:lower:]'"
set name of tag tagName to lowerCaseString
@dkgrieshammer
dkgrieshammer / setup.md
Created April 25, 2018 16:06 — forked from novemberborn/setup.md
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@dkgrieshammer
dkgrieshammer / fivebuttonskeyboard.ino
Created November 20, 2018 17:15
Arduino Leonardo 5-Button Keyboard
/*
Keyboard Message test
For the Arduino Leonardo and Micro.
Sends a text string when a button is pressed.
The circuit:
- pushbuttons attached from pin 2 pin 6 connected to Ground
- Interal Pullups used
@dkgrieshammer
dkgrieshammer / nextionButtons.ino
Created November 26, 2018 20:23
Nextion Display on Arduino Micro as Keyboard Input :)
#include <SoftwareSerial.h>
#include "Keyboard.h"
SoftwareSerial mySerial(9, 10); // RX, TX
void setup() {
Serial.begin(9600);
// Serial1.begin(9600);
mySerial.begin(9600);
Keyboard.begin();
@dkgrieshammer
dkgrieshammer / IPAddress_to_char.c
Last active May 6, 2019 20:10 — forked from drewler/epd_ipd.c
Arduino - IPAddress to char*
char IP[] = "xxx.xxx.xxx.xxx"; // Buffer
IPAddress ip = WiFi.localIP();
ip.toString().toCharArray(IP, 16);
//IP now contains IPAddress
@dkgrieshammer
dkgrieshammer / debug.ino
Created September 18, 2019 11:34
Really Nice Debugging Solution
// Nice Debugging Solution by GrooveFlotilla
//#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.print (x)
#define DEBUG_PRINTDEC(x) Serial.print (x, DEC)
#define DEBUG_PRINTLN(x) Serial.println (x)
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTDEC(x)
#define DEBUG_PRINTLN(x)