Skip to content

Instantly share code, notes, and snippets.

@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active May 10, 2024 18:47
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;