Skip to content

Instantly share code, notes, and snippets.

View codetricity's full-sized avatar

Craig Oda codetricity

View GitHub Profile
@codetricity
codetricity / gist:9309998
Created March 2, 2014 17:21
Example of Python, Pygame, PGS4A Sound
import pygame, sys
pygame.init()
try:
import android
except ImportError:
android = None
if android:
@codetricity
codetricity / Vagrantfile
Created August 10, 2017 17:11
Vagrantfile to install MapD Charting on Windows 10 or any other OS for development
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile for MapD Charting, updated 8/10/2017
# Install Vagrant https://www.vagrantup.com/
# Put this file into a new directory call this file Vagrant file
# from the command line, do
# vagrant up
# vagrant ssh
# Change directory into mapd-charting, then do
@codetricity
codetricity / Vagrantfile
Created August 10, 2017 23:47
Vagrant file for MapD Charting. Needs to be run from a DOS shell as Administrator
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile for MapD Charting, updated 8/10/2017
# Install Vagrant https://www.vagrantup.com/
# Put this file into a new directory call this file Vagrant file
# from the command line, do
# vagrant up
# vagrant ssh
# Change directory into mapd-charting, then do
@codetricity
codetricity / connector.js
Created August 28, 2017 18:26
MapD Tweetmap-2 database connector
require("@mapd/connector/dist/browser-connector")
const Connector = window.MapdCon
const connection = new Connector()
.protocol("https")
.host("metis.mapd.com")
.port("443")
.dbName("mapd")
.user("mapd")
.password("HyperInteractive")
@codetricity
codetricity / crossfilter.js
Created August 28, 2017 18:31
MapD Crossfilter example in the MapD Tweetmap-2 demo
import * as CrossFilter from "@mapd/crossfilter"
import {TABLE_NAME} from "../constants"
let crossfilter = null
export function createCf (con) {
return CrossFilter.crossfilter(con, TABLE_NAME).then(cf => {
crossfilter = cf
return Promise.resolve(cf, con)
})
@codetricity
codetricity / spitcastExpress.js
Created October 21, 2017 16:25
Spitcast API test with JavaScript, node and ExpressJS
const express = require('express')
const app = express()
var Client = require('node-rest-client').Client;
var client = new Client();
var url = 'http://api.spitcast.com/api/spot/forecast/149'
var forecast;
@codetricity
codetricity / chart-lesson-01.html
Last active February 6, 2018 02:42
caitlyn Chart.js example lesson #1
<head>
<script src="Chart.js"></script>
<style>
canvas {
border: 1px;
border-color:black;
border-style: solid;
}
</style>
</head>
@codetricity
codetricity / chart-lesson-02.html
Last active February 6, 2018 03:49
Canvas.js Lesson #2
<head>
<script src="Chart.js"></script>
<style>
canvas {
border: 1px;
border-color:black;
border-style: solid;
}
#navBar {
@codetricity
codetricity / chart-doughnut-lesson.html
Created February 7, 2018 14:30
Example use of Chart.js as doughnut chart
<script src="Chart.js"></script>
<canvas id="myChart" width="400" height="400"></canvas>
<script>
context = document.getElementById('myChart').getContext('2d');
var pieChart = new Chart(context, {
type: 'doughnut',
@codetricity
codetricity / chocolate-parser.js
Created February 12, 2018 01:49
Example of using jquery.csv.js
var fs = require('fs');
var $ = jQuery = require('jquery');
require('./jquery.csv.js');
var contents = fs.readFileSync('flavors_of_cacao.csv', 'utf8')
var data = $.csv.toArrays(contents);
var rating_1 = 0;
var rating_1_5 = 0;
var rating_1_75 = 0;