Skip to content

Instantly share code, notes, and snippets.

View heaversm's full-sized avatar

Mike Heavers heaversm

View GitHub Profile
@heaversm
heaversm / react_native_bar_carousel.js
Created May 5, 2017 05:06
React Native Custom Carousel
@heaversm
heaversm / react-native-zoom-carousel.js
Created June 5, 2017 17:20
React Native Animated Zoom Carousel
@heaversm
heaversm / twilio-transcription-back.js
Last active January 14, 2023 11:04
Twilio Call Recording Transcriptions With Google Web Speech API
//node vars
const express = require('express')
const twilio = require('twilio')
const request = require('request')
//twilio vars
const accountSid = '###' //your twilio account SID
const authToken = "###" //your twilio auth token
const client = require('twilio')(accountSid, authToken)
const baseURL = 'https://api.twilio.com/2010-04-01/Accounts/[YOUR_ACCOUNT_HERE]/Recordings/'
@heaversm
heaversm / CubeScript.cs
Last active October 26, 2018 04:14
A script for rotating a game object around its Y axis in Unity using OSCSimpl
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeScript : MonoBehaviour {
public OscIn oscIn;
public GameObject go;
private float receivedVal;
@heaversm
heaversm / accel.ino
Created March 19, 2018 03:33
Arduino Code to use the accelerometer of a LightBlue Bean to act as mouse x and y coordinates via HID
void setup() {
BeanHid.enable();
}
void loop() {
AccelerationReading accel = Bean.getAcceleration();
int16_t x = accel.xAxis;
int16_t y = accel.yAxis;
int16_t z = accel.zAxis;
@heaversm
heaversm / led_slack_messenger.ino
Created March 20, 2018 04:10
Arduino sketch to handle input from a grove push button, light up an LED bar, and send messages via HID to Slack
/*
Grove LED Bar
dec hex binary
0 = 0x0 = 0b000000000000000 = all LEDs off
5 = 0x05 = 0b000000000000101 = LEDs 1 and 3 on, all others off
341 = 0x155 = 0b000000101010101 = LEDs 1,3,5,7,9 on, 2,4,6,8,10 off
1023 = 0x3ff = 0b000001111111111 = all LEDs on
| |
10 1
@heaversm
heaversm / pix2pix-imagemagick.md
Created May 4, 2018 19:01
Pix2Pix image processing commands with ImageMagick and Montage

Image Processing with ImageMagick

Grid of Images to Individual Images

Given a grid of images, generate single images

@heaversm
heaversm / quickdraw-d3.html
Last active May 10, 2018 17:44
Google Quickdraw D3 SVG Viewer
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
@heaversm
heaversm / datgui-build.js
Last active February 6, 2024 03:52
Automatically build a dat gui from a javascript object
config = { //SAMPLE OBJECT - replace this with your data object
stroke: 2, //svg stroke value
opacity: 0.3, //0-1
offsetX: 120, //px
offsetY: 80,
fontWeight: 400, //css font-weight
fontSize: 12, //in px
changePositive: '\u25B4', //unicode character for up arrow
changeNegative: '\u25BE', //unicode character for down arrow
colorBlue: '#1190A3', //all hex colors will automatically use the addColor dat gui function
@heaversm
heaversm / skyboxstereo.shader
Created September 5, 2018 16:24
Unity Skybox Stereo Shader
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
Shader "Skybox/CubemapStereo" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure ("Exposure", Range(0, 8)) = 1.0
_Rotation ("Rotation", Range(0, 360)) = 0
[NoScaleOffset] _TexLeft ("Cubemap (HDR)", Cube) = "grey" {}
[NoScaleOffset] _TexRight ("Cubemap (HDR)", Cube) = "grey" {}
}