Skip to content

Instantly share code, notes, and snippets.

View codetricity's full-sized avatar

Craig Oda codetricity

View GitHub Profile
@codetricity
codetricity / chocolate-parser-by-country.js
Created February 18, 2018 03:27
Chocolate parser by country
var fs = require('fs');
var $ = jQuery = require('jQuery');
require('./jquery.csv.js');
var sample = './flavors_of_cacao.csv';
var csv = fs.readFileSync(sample, 'UTF-8');
var arrays = $.csv.toArrays(csv);
var usa = 0;
var france = 0;
@codetricity
codetricity / theta_client_mode.py
Created February 26, 2018 22:54
THETA V Client Mode Test Script using Digest Authentication
"""
Test for THETA V client mode. Your workstation and the THETA V need to be
connected to the same WiFi router.
This test script uses Python modules requests and pprint.
To install requests and pprint
$ pip install requests
$ pip install pprint
Once connected with WiFi, use the API here:
@codetricity
codetricity / theta_v_discover.py
Last active November 8, 2019 08:07
Ricoh THETA V client mode WiFi discovery for use with companion script to run WiFi API to control camera
#!/usr/bin/env python3
""" Example of browsing for a service (in this case, HTTP) """
import logging
import socket
import sys
from time import sleep
from zeroconf import ServiceBrowser, ServiceStateChange, Zeroconf
@codetricity
codetricity / blocks.html
Created February 27, 2018 05:51
blocks for loop and random number lesson
<canvas id='myCanvas' width="400" height="400"></canvas>
<script>
var ctx = document.getElementById('myCanvas').getContext('2d');
var colors = [
'red',
'blue',
'green',
'yellow',
'purple']
@codetricity
codetricity / lines.html
Created March 16, 2018 04:26
function lesson
<meta charset="utf-8">
<canvas id="myCanvas" width="800" height="600"></canvas>
<br>
<button onclick="horizLines()">Horizontal</button>
<button onclick="diagonalLines()">Diagonal</button>
<button onclick="clearScreen()">Clear</button>
<script>
@codetricity
codetricity / lines2.html
Created March 16, 2018 13:30
function lesson with checks on finished drawing
<head>
<meta charset="utf-8">
<style>
.buttonRow{
margin-top: 10px;
}
</style>
</head>
@codetricity
codetricity / lines-radio.html
Created March 18, 2018 03:44
Lines with radio button
<canvas id="myCanvas" width="400" height="400"></canvas>
<div>
<form>
<input type="radio" id="10lines" name="lineNumber" value="10" checked> 10 lines
<br>
<input type="radio" id="20lines" name="lineNumber" value="20"> 20 lines
</form>
<br>
<button onclick="createManyLines(10)">Create Lines</button>
</div>
@codetricity
codetricity / lines-style.html
Last active March 19, 2018 13:30
line with style button
<canvas id="myCanvas" width="400" height="400"></canvas>
<div>
<table>
<tr>
<th># lines</th>
<th>Orientation</th>
</tr>
<tr>
<td>
<input type="radio" name="lineNumber" value="10" checked> 10 lines
@codetricity
codetricity / forEachDrill.js
Created April 9, 2018 15:38
use of forEach
/***
create: function(){
var platformData = [
{"x": 0, "y": 430},
{"x": 45, "y": 560},
{"x": 90, "y": 290},
{"x": 0, "y": 140}
];
this.platforms = this.add.group();
this.platforms.enableBody = true;
@codetricity
codetricity / theta_v_htc_vive.cs
Created April 17, 2018 00:49
Sample script to use the THETA V with HTC Vive. Uses SteamVR and Unity
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
string camName;
public const string RICOH_DRIVER_NAME = "RICOH THETA V 4K";
// change to "RICOH THETA V FullHD" for lower resolution
// (and thus smaller data size)