Skip to content

Instantly share code, notes, and snippets.

Nerding out on code

DJ Mason djmason9

Nerding out on code
View GitHub Profile
View Iluminati badge code
unsigned long csSum;
int looptype = 0;
int touchPad = 4;
int red = 0; //IO1 pin 7
int green = 1; //IO3 pin 2
int blue = 2; //IO3 pin 2
int state = HIGH;
int r;
int p = HIGH;
View kiosk-dockerfile
# See the for usage and configuration info
# This line defines which node.js Docker image to leverage
# Available versions are described at
FROM node:8-alpine
# Sets the default working directory to /app which is where we copy the service files to.
# TODO: for security purposes, you should update this Dockerfile to specify your own target user/group
View kiosk-nodeserver.js
(function () {
console.log("node app starting");
var io = require('').listen(process.env.PORT || 4001);
io.sockets.on('connection', function (socket) {
console.log("is connected");
socket.on("doPlay", function (data) {
console.log("doPlay " +;
socket.broadcast.emit('doPlayLocal', { id: });
djmason9 /
Created February 17, 2020 16:30 — forked from AGWA/
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
tvservice -s | grep "TV is off" >/dev/null
case $1 in
djmason9 /
Last active January 29, 2020 21:24
Axway AMPLIFY API Builder and MongoDB Containerization in 5 minutes

Create The API Builder Project

Build Project

api-builder init axwayairport

Install Modules

cd axwayairport
npm install --no-optional
View index.htm
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src=""></script>
<script src="js/player.js"></script>
View utils.js
var Arrow = require('arrow');
var io = require('');
var socket = io.connect("");
exports.sendPlay = function(id, callback) {
console.log('utils: sendPlay() called');
socket.emit('doPlay',{id : id});
View player.js
var socket = io.connect("");
document.addEventListener("DOMContentLoaded", function(event) {
var media = document.querySelector('video');
socket.on("doPlayLocal", function (data) {
console.log("doPlayLocal called");
View alexaapphandler.js
var Arrow = require('arrow');
var verifier = require('alexa-verifier');
var Utils = require('lib/utils');
var launchTxt = "Welcome to Griffin Healthcare Demo Video. You can ask Griffin Healthcare to play the demo video.";
var AlexaAppHandler = Arrow.API.extend({
group: 'alexa',
path: '/api/alexaapphandler',
djmason9 / AppceleratorUsingES6.js
Last active June 19, 2020 17:51
Simple ES6 Example in Appcelerator along with Alloy
View AppceleratorUsingES6.js
class Application {
constructor(win) {
this.window = $.index; //window defined in index.xml
open() {;