This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: A UnityEngine.UI.Graphic subclass that provides only raycast targeting, skipping all drawing. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Add a `NonDrawingGraphic` component to the GameObject you want clickable, but without its own image/graphics. | |
/// @intended project path: Assets/Plugins/UnityEngine UI Extensions/NonDrawingGraphic.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/349c18283f2fea316369 | |
using UnityEngine; | |
using UnityEngine.UI; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class TestLateFixedUpdate : MonoBehaviour | |
{ | |
void OnEnable() { | |
StartCoroutine("RunLateFixedUpdate"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Tags all dangling commits in a Git repo (for the wonderful “oh shit” moments). | |
# @from: https://gist.github.com/capnslipp/2656868 | |
git fsck --lost-found #--no-reflogs --full --root --cache --tags --unreachable | |
find '.git/lost-found/commit' -type f | while read i; do | |
commit_sha=`cat "$i"` | |
git tag -f "git-lf/commit/$commit_sha" $commit_sha | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: More-flexible GO-tree searching for Components by type, configurable via `SearchExtent` enum arg. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Call `this.gameObject.FindComponent<«component-type»>(«SearchExtent-type»);`. | |
/// @intended project path: Assets/Plugins/UnityEngine Extensions/GameObjectFindComponentExtension.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/ac26e38fce770b5c4594 | |
using System; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: Shows a field as disabled in Unity's Inspector only when a different method/property/field in the same MonoBehaviour returns/is-equal-to a given value or values. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Add `[DisableWhen(typeof(«MonoBehaviour-sub-type-name»), "«trigger-member-name»", «value-that-the-trigger-member-returns»)]` attribute to a (serializable public) field on your `MonoBehaviour`-class. | |
/// @intended project path: Assets/Plugins/EditorUtils/DisableWhenAttribute.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/9b99f83aa7b80dfb589a5b23e8e0cfa0 | |
using System; | |
using UnityEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @creator: Slipp Douglas Thompson | |
/// @license: Public Domain per The Unlicense. See <http://unlicense.org/>. | |
/// @purpose: Genericized Unity3D SerializedProperty value access. | |
/// @why: Because this functionality should be built-into Unity. | |
/// @usage: Use as you would a native SerializedProperty method; | |
/// e.g. `Debug.Log(mySerializedProperty.Value<Color>());` | |
/// @intended project path: Assets/Plugins/Editor/UnityEditor Extensions/SerializedPropertyValueExtension.cs | |
/// @interwebsouce: https://gist.github.com/capnslipp/8516384 | |
using System; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Base | |
[core] | |
excludesfile = /Users/capnslipp/.git_excludes | |
attributesfile = /Users/capnslipp/.git_attributes | |
#editor = mate -w | |
editor = macdown-wait | |
whitespace = tabwidth=4, space-before-tab, indent-with-non-tab, blank-at-eol, blank-at-eof | |
# defaults: whitespace = blank-at-eol, space-before-tab, -indent-with-non-tab, -tab-in-indent, blank-at-eof, trailing-space, -cr-at-eol, tabwidth=8 | |
quotepath = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
test ! -z "$1" && TARGET_COMMIT_SHA="$1" || TARGET_COMMIT_SHA="HEAD" | |
TARGET_COMMIT_PATCHID=$( | |
git show --patch-with-raw "$TARGET_COMMIT_SHA" | | |
git patch-id | | |
cut -d' ' -f1 | |
) | |
MATCHING_COMMIT_SHAS=$( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
arch="$(uname -m)" | |
sdk_path="$(xcrun --sdk driverkit --show-sdk-path)" | |
sdk_version="$(xcrun --sdk driverkit --show-sdk-version)" | |
echo "Running: " \ | |
swift build -Xswiftc "-sdk" -Xswiftc "${sdk_path}" -Xswiftc "-target" -Xswiftc "${arch}-apple-driverkit${sdk_version}" "$@" | |
swift build -Xswiftc "-sdk" -Xswiftc "${sdk_path}" -Xswiftc "-target" -Xswiftc "${arch}-apple-driverkit${sdk_version}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
@author: Slipp Douglas Thompson | |
@purpose: Pauses Spotify after the current song finishes playing. | |
@todo: Optimize so it's more efficient. | |
@usage: Drop a compiled script (a .scpt file, converted with AppleScript Editor if this is a .applescript file) into ~/Library/Scripts/Applications/Spotify. | |
Ensure than “Show Script menu in menu bar” is enabled (which can be found in the AppleScript Editor preferences). | |
When playing a song in Spotify and wishing to stop the music when the track finished, choose “When Song Finishes, Pause” from the script menu, and then walk, walk away. | |
*) | |
tell application "Spotify" | |
log "“When Song Finishes, Pause”: player state is " & (player state) |
NewerOlder