Skip to content

Instantly share code, notes, and snippets.

View Data-ptr's full-sized avatar

Data*Ptr Data-ptr

View GitHub Profile
//
// A little macro that takes a percentage and chnages it to 0-255
//
#define MAX_VALUE 255
#define PER_TO_VAL(percent) ((MAX_VALUE/100) * percent)
typedef enum DmxCh {
RED = 1,
GREEN = 2,
BLUE = 3

Random unlabeled DMX lamps settings

Buttons

Seven segment LED up

 > Mode
|
| > Down
/*
DMX_Master.ino - Example code for using the Conceptinetics DMX library
Copyright (c) 2013 W.A. van der Meeren <danny@illogic.nl>. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@Data-ptr
Data-ptr / debianpreseedosx.sh
Created April 21, 2018 16:58
Modifying a Debian ISO (amd64) with a preseed file, but on OSX
#
# Figured out using:
# https://wiki.debian.org/DebianInstaller/Preseed/EditIso
# https://www.thegeekstuff.com/2009/07/how-to-view-modify-and-recreate-initrd-img/
# https://gist.github.com/Aktau/5510437
# https://www.cyberciti.biz/faq/how-to-extract-a-deb-file-without-opening-it-on-debian-or-ubuntu-linux/
#
## Go home
cd
@Data-ptr
Data-ptr / soundmeter-exec.sh
Created April 19, 2018 21:32
Using soundmeter to trigger a script if the mic input is above $RMS Rms (when a loud sound is present)
PROG=hello.sh;RMS=100;soundmeter --trigger +$RMS --action exec --exec $PROG
@Data-ptr
Data-ptr / tilting.ino
Created March 11, 2018 23:21
Getting direction tilting (out of 360) from IMU (in this case the CurieIMU) and display as pixel on NeoPix ring
/*
* This is a modified version of the Visualize101.ino example sketch
* https://github.com/arduino-libraries/MadgwickAHRS/blob/master/examples/Visualize101/Visualize101.ino
*
* Modified starting March 10th, 2018 by Jane Hacker (JAH)
*
* XYZ_M = Macro
* xyz_g = Global
* xyz_t = Type
*
@Data-ptr
Data-ptr / WRGB-flashlight.ino
Last active June 10, 2017 02:57
Building a White, Red, Green, Blue Flashlight with NeoPixels and an ATTiny/85
// +---+
// | |
// | |
// |Neo|
// | |
// | |
// +---+
// | |
// | |
// |Pix|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.5.1/rickshaw.min.css">
@Data-ptr
Data-ptr / clone-all-heroku-apps.bash
Created January 14, 2016 18:10
Just authenticated to a Heroku login and want to quickly clone all the applications into their own directories? In a "one-liner?" Remember, you have to be authenticated, `$ heroku apps` should list the applications.
for HEROKU_APP in $(heroku apps | tail -n+2); do export REPO_DIR="heroku-${HEROKU_APP}"; if [ ! -d "$REPO_DIR" ]; then mkdir "$REPO_DIR"; cd "$REPO_DIR"; heroku git:clone ./ -a "${HEROKU_APP}"; cd ..; fi done
@Data-ptr
Data-ptr / gitlab-markdown-toc-generator.js
Created January 14, 2016 16:49
For use on GitLab circa 14-01-2016. Injects a "Create ToC?" link under the project's name if Markdown style anchors are found on the page. Click the link and a Markdown compatable table of contents will appear in the browser's console! Copy-and-paste it into your Markdown (like README.md).
// ==UserScript==
// @name GitLab Markdown TOC Generator
// @namespace GLMdToCg
// @description For use on GitLab circa 14-01-2016. Injects a "Create ToC?" link under the project's name if Markdown style anchors are found on the page. Click the link and a Markdown compatable table of contents will appear in the browser's console! Copy-and-paste it into your Markdown (like README.md).
// @include *gitlab.com*
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener(