Skip to content

Instantly share code, notes, and snippets.

@blevok
blevok / GyroCamera.cs
Last active October 2, 2021 06:27 — forked from kormyen/GyroCamera.cs
Gyro camera rotation for Android, tested in Unity 2019.3.2 for API level 28, in landscape left orientation.
// Gyro camera rotation for Android, tested in Unity 2019.3.2 for API level 28, in landscape left orientation.
// Extended to include X and Z axis when claibrating, so you can re-center when looking in any direction, and at a variable speed.
// Attach this script to the parent GameObject of your camera. To re-center, from your main script, call CalibrateAngle, set a bool "letsGoToCenter" to true, a bool "goToCenterSlowly" to true or false, and a string "centerRotSpeed" to slow or fast.
// centerRotSpeed is ignored when goToCenterSlowly is false. You can use "Unity Remote 5" in the Play store to test Android gyro in Unity editor.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GyroCamera : MonoBehaviour
@neauoire
neauoire / josh.md
Last active October 20, 2019 17:23

For Josh Castle

You seem very stable mentally and emotionally, at least from the outside. Is that an accurate perception? Or is that just how you appear through the lens of social media?

It's possible that I am, but the way I see it, I might have less of an emotional dynamic range than some people, I definitely also oscillate between better and worse moods, but less intense highs and lows.

You track lots of things about yourself; do you also track your mood? And do you make an effort to fight it or to stabilize it, or do you just try to "go with the flow" and let your mood dictate your workflow?

I don't track my moods, but as my moods usually follow my tracked input/output, so moods can be inferred. I am happiest when I get to dedicate myself fully to any one task. So, that being said, tracking the way I do, can be seen as stabilizing my moods? I never have professional frustration, and I can very easily imagine that affecting my moods. To go with the flow, you have to be able to see the fl

@eelfroth
eelfroth / circles.pde
Last active September 9, 2018 16:42
circle fractal generator
// this is Processing source code
// get the IDE at processing.org
// and type in this little program
// tweak the numbers to explore...
float S = 1; //step
float W = 10; //weight
float A = 255; //alpha
float R = PI/3; //rotation
float M = 0; //modulo

For Hannah

Your creative output spans several disciplines - a big reason why I enjoy your work - while a goal of yours is preventing multi-tasking. Can you define what unproductive multi-tasking looks like to you vs. what have you found to be a productive way to shift your focus from one discipline to another?

It comes down to scope and granularity. The ideal focused work to me is a session of 25:00 pomodoro. Undistracted, focusing on a single task, with a single tool, undisturbed. Then, throughout the day, the relationship between each of the pomodoros, would be done for a singular project.

An unproductive multi-tasking day, would include interrupted sessions of pomodoros, over multiple unrelated projects.

In your tracking, I like that you differentiate between focused input, like listening to music, and output, like performing music. How do you decide what is an appropriate output of something you are curious about and what's your process like to allocate the right about time towards it?

@PostEpoch
PostEpoch / ResizeReorderableListExample.cs
Last active December 19, 2018 08:32 — forked from p-groarke/ResizeReorderableListExample.cs
Resize Unity Reorderable List example.
// Originally from MALQUA
// https://feedback.unity3d.com/suggestions/custom-element-size-in-reorderable-list
// http://i.imgur.com/fIbBorr.gifv
// and SOCAPEX
// https://gist.github.com/Socapex/1d9b45507464681d530b
// Modified by Jesse Hamburger
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
@t0chas
t0chas / CustomEditorBase.cs
Last active March 5, 2024 16:47
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@pragmaticlogic
pragmaticlogic / node-apps-startup.sh
Last active September 4, 2020 14:58
node-apps-startup.sh
#!/bin/bash
#
# An init.d script for running a Node.js process as a service using iptables, forever and bouncy
# Reference:
# 1- https://github.com/nodejitsu/forever
# 2- https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/
source /home/kle/.nvm/nvm.sh
NAME="Script for all NodeJS apps"
NVM_VERSION="v0.10.31"
@Flafla2
Flafla2 / Perlin_Tiled.cs
Last active June 20, 2024 04:38
A slightly modified implementation of Ken Perlin's improved noise that allows for tiling the noise arbitrarily.
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
@jcdickinson
jcdickinson / colorblind.glsl
Last active April 28, 2024 23:27
Colorblind Simulation Shader
/*-----------------------------------------------------------.
/ ColorBlind correction /
'-----------------------------------------------------------*/
// Daltonize (source http://www.daltonize.org/search/label/Daltonize)
// Modified to simulate color blindness.
float4 Daltonize( float4 input, float2 tex )
{
// RGB to LMS matrix conversion
float3 L = (17.8824f * input.r) + (43.5161f * input.g) + (4.11935f * input.b);
float3 M = (3.45565f * input.r) + (27.1554f * input.g) + (3.86714f * input.b);