Skip to content

Instantly share code, notes, and snippets.

@prnthp
prnthp / OneGrabKnobTransformer.cs
Last active October 3, 2024 15:16
Transformer for on axis rotations such as knobs. It is better than OneGrabRotateTransformer for this use case.
/************************************************************************************
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
https://developer.oculus.com/licenses/oculussdk/
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, either express or implied. See the License for the specific language governing
permissions and limitations under the License.
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active February 19, 2025 20:43
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@marcusmonteiro
marcusmonteiro / download_files_on_safari_instead_of_opening_them.txt
Created December 9, 2017 17:58
Download files on Safari instead of opening them #safari #download
// from https://apple.stackexchange.com/questions/57039/how-make-safari-download-pdf-files-instead-of-opening-them-in-page
You can make Safari on the Mac download ANY files (mp3, mp4, jpg, pdf and more) by doing the following.
Open the file (movie,music,etc) in Safari. That normally comprises of clicking the link to the pdf/movie/music etc.
Click on the url of the browser (in this case it would end in ".../xyz.pdf".
Hold option down and press Return(or Enter).
The file you are viewing downloads to the Downloads folder on the mac.
I've tested this with almost all file types possible. Very very useful little feature that unfortunately too few people know about.
@kormyen
kormyen / GyroCamera.cs
Last active September 22, 2023 13:37
Unity3D script for rotating camera with a phone's gyro. Includes smoothing and initial offset. Edited from https://forum.unity3d.com/threads/sharing-gyroscope-camera-script-ios-tested.241825/
using UnityEngine;
using System.Collections;
public class GyroCamera : MonoBehaviour
{
// STATE
private float _initialYAngle = 0f;
private float _appliedGyroYAngle = 0f;
private float _calibrationYAngle = 0f;
private Transform _rawGyroRotation;