Skip to content

Instantly share code, notes, and snippets.

View mrmccormack's full-sized avatar

Rob McCormack mrmccormack

View GitHub Profile
@mrmccormack
mrmccormack / README.md
Last active April 10, 2018 12:17
Example using JavaScript Standard formatting

Understanding "JavaScript Standard" format

  • The code shown here: refreshcomposite.js is how you might be writing JavaScript
  • Let's try to format this up using the "JavaScript Standard" - which is gaining in popularite

Movie of the Week

  • Watch this... put in WILDocument
  • Mr. M. subscribes to his channel Fun Fun functions
  • a programmer at Spotify... what is his background
@mrmccormack
mrmccormack / test.md
Created April 15, 2018 17:36
test tabris naming convention

|a| b |c |--|--| | e | f|h

@mrmccormack
mrmccormack / camera.js
Created April 17, 2018 12:33
IM415 Simple Camera App
const { Button, ImageView, ui } = require('tabris')
const widthPhoto = 300
const heightPhoto = 400
function takePhoto () {
let onSuccess = image => imgPhoto.image = image
let onFail = message => console.log('Camera failed because: ' + message)
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
@mrmccormack
mrmccormack / camera-monkey.js
Created April 17, 2018 19:19
Camera long press Tabris.js Monkey image
const { Button, ImageView, ui } = require('tabris')
const widthPhoto = 300
const heightPhoto = 400
function takePhoto () {
let onSuccess = image => imgPhoto.image = image
let onFail = message => console.log('Camera failed because: ' + message)
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
@mrmccormack
mrmccormack / motion.js
Created April 18, 2018 12:19
Tabris.js simple motion detection - a greatly simplified example.
// ref: https://github.com/eclipsesource/tabris-js/issues/1627 with thanks to Tabris on github
// done as a tutorial for my students
const { Button, TextView, ui } = require('tabris')
function onSuccess(acceleration) {
txvAccelerationX.text = 'Acceleration X: ' + acceleration.x
txvAccelerationY.text = 'Acceleration Y: ' + acceleration.y
txvAccelerationZ.text = 'Acceleration Z: ' + acceleration.z
txvTimeStamp.text = 'Timestamp: ' + getFormattedDate(acceleration.timestamp)
@mrmccormack
mrmccormack / tabristest.js
Created April 25, 2018 18:57
Test Tabris hosted
// ref https://tabrisjs.com/api/v1/pins/5a32c9adb364b0e4f14166bd
const {ImageView, ScrollView, ui} = require('tabris');
const IMAGES = [
"heic0305a.jpg",
"IRS46_nasa.jpg",
"catseye.jpg",
"heic0405a.jpg",
"heic0414a.jpg",
@mrmccormack
mrmccormack / default.js
Created April 25, 2018 19:01
Test default tabris
// https://tabrisjs.com/api/v1/pins/5ae0cff3ee64b0e448b9c190
// This is a simple Tabris.js app. Feel free to modify as you please.
// Changes are saved immediately and will be available on your device after reload.
const {Button, TextView, ui} = require('tabris');
// Create a push button and add it to the content view
let button = new Button({
centerX: 0, centerY: 0,
text: 'Tap here Taylar zzzzzzzzzzzzzz'
@mrmccormack
mrmccormack / k-show-hide-button.html
Created April 27, 2018 14:14
Bootstrap 3 show hide content toggle button
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>??? Enter YOUR TITLE HERE</title>
@mrmccormack
mrmccormack / tabs.js
Created May 1, 2018 20:05
Tabrisjs folder tab example for T.
/*
TabFolder, Tab and WebView
@version:2.4
Snippet url:
- http://
References:
- https://tabrisjs.com/documentation/latest/api/TabFolder.html
*/
const {Button, Tab, TextInput, TabFolder, TextView, ImageView, ui} = require('tabris');
@mrmccormack
mrmccormack / kaikikibeta.html
Last active May 4, 2018 17:28
Kai-collapse
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>KaiKi_KiBeta</title>