Skip to content

Instantly share code, notes, and snippets.

View mikedg1's full-sized avatar
๐Ÿ˜ƒ

Mike DiGiovanni mikedg1

๐Ÿ˜ƒ
View GitHub Profile
@mikedg1
mikedg1 / BoardSetup.cs
Created January 29, 2026 11:41
Board.fun Project Setup Helper
#if UNITY_EDITOR
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Build;
#endif
public class BoardSetup : MonoBehaviour {
[MenuItem("Board/Project Setup/Run All - Including Optional")]
private static void RunAll() {
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
/**
* Ask all children to measure themselves and compute the measurement of this
* layout based on the children.
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mPortrait = (ViewGroup) findViewById(R.id.portrait);
if (mPortrait != null) {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPortrait.getLayoutParams();
@mikedg1
mikedg1 / glass.html
Last active November 30, 2020 19:29
[wearscript] Mouth, publisher for whisper
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function server() {
@mikedg1
mikedg1 / glass.html
Last active November 30, 2020 19:29
[wearscript] Ear, for listening to channel and playing audio in your ear.
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function server() {
@mikedg1
mikedg1 / glass.html
Last active November 30, 2020 19:34
[wearscript] test
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function server() {
@mikedg1
mikedg1 / glass.html
Last active November 30, 2020 19:34
[wearscript]
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
//test 2
function cb(data) {
@mikedg1
mikedg1 / gist:1178234
Last active November 30, 2020 19:34
Low Memory Resizing
public static Bitmap resize(Context context, Uri uri) {
// decodes image and scales it to reduce memory consumption
try {
// Decode image size
BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeStream(context.getContentResolver().openInputStream(uri), null, o);
// The new size we want to scale to