Skip to content

Instantly share code, notes, and snippets.

View djmason9's full-sized avatar
🤓
Nerding out on code

DJ Mason djmason9

🤓
Nerding out on code
View GitHub Profile
@djmason9
djmason9 / gist:d63a769e8fbf80cce2d19b4824e18b71
Created August 7, 2017 15:29 — forked from Qwerios/gist:ae0bcd32dc1c5c871d06
My Jenkins for Appcelerator mobile CI

Hardware & OS

Running on Apple Mac mini Dualcore i5 2.8GHz (MGEQ2FN/A) OSX Yosemite: 10.10.1

UPDATE Nov 3rd 2015: Upgraded to El Capitan caused my Jenkins to stop working. I had to apply the file permission fix for the log folder again (see known issues at the end of this gist). I also had to reinstall legacy java support and load the jenkins daemon again with launchctl. I took the time to update all the components mentioned in this gist when I did the upgrade. So the Android sdk/ndk, nodejs (0.10 -> 0.12), Titanium and Java. Beware that there is a new command-line tool for titanium (appc from the 'appcelerator' package).

User account setup

I installed and setup the new Mac with 1 main administrative account. In the scripts below it is assumed you are logged in as this administrative user. Changing to the jenkins user is done using sudo su - jenkins.

Required accounts

@djmason9
djmason9 / AppceleratorUsingES6.js
Last active June 19, 2020 17:51
Simple ES6 Example in Appcelerator along with Alloy
class Application {
constructor(win) {
this.window = $.index; //window defined in index.xml
}
open() {
this.window.open();
}
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',
var socket = io.connect("http://mydomain.ngrok.io.ngrok.io");
document.addEventListener("DOMContentLoaded", function(event) {
var media = document.querySelector('video');
socket.on("doPlayLocal", function (data) {
console.log("doPlayLocal called")
media.play();
});
var Arrow = require('arrow');
var io = require('socket.io-client');
var socket = io.connect("http://mydomain.ngrok.io.ngrok.io");
exports.sendPlay = function(id, callback) {
console.log('utils: sendPlay() called');
socket.emit('doPlay',{id : id});
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://mydomain.ngrok.io.ngrok.io/socket.io/socket.io.js"></script>
<script src="js/player.js"></script>
</head>
@djmason9
djmason9 / apibuilderdocker.md
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
@djmason9
djmason9 / rpi-hdmi.sh
Created February 17, 2020 16:30 — forked from AGWA/rpi-hdmi.sh
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.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
(function () {
console.log("node app starting");
var io = require('socket.io').listen(process.env.PORT || 4001);
io.sockets.on('connection', function (socket) {
console.log("is connected");
socket.on("doPlay", function (data) {
console.log("doPlay " + data.id);
socket.broadcast.emit('doPlayLocal', { id: data.id });
# See the README.md for usage and configuration info
# This line defines which node.js Docker image to leverage
# Available versions are described at https://hub.docker.com/_/node/
FROM node:8-alpine
# Sets the default working directory to /app which is where we copy the service files to.
WORKDIR /app
# TODO: for security purposes, you should update this Dockerfile to specify your own target user/group