Skip to content

Instantly share code, notes, and snippets.

{ //start script
app.beginUndoGroup("foo");
// create project if necessary
var proj = app.project;
if(!proj) proj = app.newProject();
// create new comp named 'my comp'
var compW = 1920; // comp width
var compH = 1080; // comp height
#!/bin/bash
cd "$(dirname ${BASH_SOURCE})"
cd ../..
APP_ROOT=$(pwd)
cd Contents/Java
JAR_LIBS=$(ls *.jar | tr "\n" ":")
JAR_LIBS=${JAR_LIBS}./SimpleOpenNI/library/SimpleOpenNI.jar
APP_NAME=$(basename "${BASH_SOURCE}")
@n1ckfg
n1ckfg / MatricomManual.md
Created March 10, 2019 15:39 — forked from sli/MatricomManual.md
Transcribed manual for Matricom GPad controllers.

Matricom Gamepad

For your enjoyment and safety, we recommend that you read this manual thoroughly before using this product and keep this manual handy for reference if needed.

Characteristics:

  1. Compatible with Android and PC
  2. Wireless
  3. D-Pad and 12 buttons
  4. Dual analog joysticks
@n1ckfg
n1ckfg / AutoCrop.pde
Created March 13, 2019 05:07
Crop an image based on background color.
import java.util.*;
PImage img, imgCropped;
color bgColor = color(0);
void setup() {
size(50, 50, P2D);
img = loadImage("test.png");
imgCropped = cropImage(img, bgColor);
string url;
#if UNITY_ANDROID
url = Path.Combine("jar:file://" + Application.dataPath + "!/assets/", readFileName);
#endif
#if UNITY_IOS
url = Path.Combine("file://" + Application.dataPath + "/Raw", readFileName);
#endif
1. Default login for a new deployment is root + your web panel pwd.
2. Install updates.
3. Set your time zone:
dpkg-reconfigure tzdata
4. Create a new admin user:
adduser username
usermod -aG sudo username
function detectMobile() {
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)) {
return true;
} else {
return false;
}
}
function detectPortrait() {
if (Math.abs(window.orientation) === 90) {
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
OniStatus VideoStream::convertDepthToWorldCoordinates(float depthX, float depthY, float depthZ, float* pWorldX, float* pWorldY, float* pWorldZ)
{
if (m_pSensorInfo->sensorType != ONI_SENSOR_DEPTH)
{
m_errorLogger.Append("convertDepthToWorldCoordinates: Stream is not from DEPTH\n");
return ONI_STATUS_NOT_SUPPORTED;
}
float normalizedX = depthX / m_worldConvertCache.resolutionX - .5f;
float normalizedY = .5f - depthY / m_worldConvertCache.resolutionY;
// https://forum.unity.com/threads/whats-the-replacement-for-www-audioclip.476997/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
[RequireComponent(typeof(AudioSource))]
public class StreamingAudioSource : MonoBehaviour
{