Skip to content

Instantly share code, notes, and snippets.

View zensharp's full-sized avatar
🌿
budding

Zensharp zensharp

🌿
budding
  • United States
View GitHub Profile
@zeevro
zeevro / K3-Pro-ANSI-White-v1.0-fixed.json
Created December 22, 2022 21:17
Fixed version of the Keychron K3 Pro white-backlight VIA JSON file
{
"name": "Keychron K3 Pro",
"vendorId": "0x3434",
"productId": "0x0233",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"customKeycodes": [
{"name": "Left Option", "title": "Left Option", "shortName": "LOpt"},
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active September 21, 2024 11:27
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@spencersalazar
spencersalazar / easeInOut.h
Created January 27, 2020 05:09
Generic easing function with tweakable power and midpoint.
/** Ease in/out function with settable power and midpoint.
Use p parameter to adjust speed at endpoints (cubic: p=3, quartic: p=4)
Midpoint is point at which speed is fastest and uneased.
@param t time or independent variable in range [0,1]. Input should be scaled to this range from whatever source range is expected.
@param p power, e.g. quadratic=2, cubic=3. Non-integral powers can be used to fine-tune the curve.
@param mid midpoint of curve, where it is "most linear".
@return output value in range [0,1]. Can be multiplied to scale to desired range.
@ngcbbs
ngcbbs / DoomGlow.cs
Last active June 19, 2022 00:14 — forked from TiliSleepStealer/DoomGlow.cs
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@Koze
Koze / speechVoices.tsv
Last active August 8, 2024 02:56
List of AVSpeechSynthesisVoice.speechVoices() on iOS Device
Language Name Quality Identifier Class
ar-SA Maged Default com.apple.ttsbundle.Maged-compact AVSpeechSynthesisVoice
cs-CZ Zuzana Default com.apple.ttsbundle.Zuzana-compact AVSpeechSynthesisVoice
da-DK Sara Default com.apple.ttsbundle.Sara-compact AVSpeechSynthesisVoice
de-DE Anna Default com.apple.ttsbundle.Anna-compact AVSpeechSynthesisVoice
de-DE Helena Default com.apple.ttsbundle.siri_female_de-DE_compact AVSpeechSynthesisVoice
de-DE Martin Default com.apple.ttsbundle.siri_male_de-DE_compact AVSpeechSynthesisVoice
el-GR Melina Default com.apple.ttsbundle.Melina-compact AVSpeechSynthesisVoice
en-AU Catherine Default com.apple.ttsbundle.siri_female_en-AU_compact AVSpeechSynthesisVoice
en-AU Gordon Default com.apple.ttsbundle.siri_male_en-AU_compact AVSpeechSynthesisVoice
@LotteMakesStuff
LotteMakesStuff / LookatTool.cs
Last active November 2, 2023 21:04
In Unity 2019.1 Unity added a new custom EditorTool API, heres some example code showing some tools we could make with it!
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;
[EditorTool("LookAt Tool")]
public class LookatTool : EditorTool
{
GUIContent cachedIcon;
// NOTE: as were caching this, unity will serialize it between compiles! so if we want to test out new looks,
@favoyang
favoyang / BuildAddressables.cs
Last active June 7, 2024 18:10
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@sinbad
sinbad / License.txt
Last active May 29, 2024 08:30
Unity 2D Line Segment Intersection
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@AArnott
AArnott / Cancellation.cs
Last active August 23, 2024 05:43
Graceful console app cancellation on Ctrl+C
class Program
{
static async Task Main(string[] args)
{
// Add this to your C# console app's Main method to give yourself
// a CancellationToken that is canceled when the user hits Ctrl+C.
var cts = new CancellationTokenSource();
Console.CancelKeyPress += (s, e) =>
{
Console.WriteLine("Canceling...");
@sergiobd
sergiobd / Skybox6-ArbitraryRotation
Created November 10, 2018 17:57
Unity skybox 6-sided with arbitrary rotation axis
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edited from Unity built-in, copied rotation function from here: http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/
Shader "Skybox/6 Sided - Arbitrary Rotation" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure ("Exposure", Range(0, 8)) = 1.0
_Rotation ("Rotation", Range(0, 360)) = 0
_RotationAxis("Rotation axis", Vector) = (0, 1, 0)
[NoScaleOffset] _FrontTex ("Front [+Z] (HDR)", 2D) = "grey" {}
[NoScaleOffset] _BackTex ("Back [-Z] (HDR)", 2D) = "grey" {}