Skip to content

Instantly share code, notes, and snippets.

Hyper Sonic hsandt

Block or report user

Report or block hsandt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hsandt
hsandt / README.md
Last active Aug 24, 2019
PICO8 0.1.11g and 0.1.12c skip intro patches for Linux 64-bit
View README.md

Patches to skip the splashscreen and logo/version display when the PICO-8 editor starts. Intended for development purpose only.

Please check the thread: https://www.lexaloffle.com/bbs/?tid=3485. It contains instructions on how to reproduce the patch for different versions and OSes.

Download one of the patches below matching your PICO-8 version, then patch your binary.

At first I didn't manage to upload binaries as raw gists, so I pasted binary dumps instead so you could convert them back to binaries with xxd reverse dump operation xxd -r my.patch.txt > my.patch.

But I managed to upload the binaries by cloning the repo and pushing the new files back, so now both the dump and raw versions of the patches are available.

@hsandt
hsandt / exec.py
Last active May 23, 2019
exec.py from Sublime Text 3.1.1 (Build 3176) patched for thread safety to avoid empty console output on build task
View exec.py
# Patched based on answer at https://github.com/SublimeTextIssues/Core/issues/2293 by kaste
# Copy it to your Packages/Default/exec.py
# Use OverrideAudit (https://github.com/OdatNurd/OverrideAudit/) to detect official script changes on Sublime Text upgrades
# Extra:
# - use read1 instead of read
# - use start_new_session=True instead of preexec_fn
import collections
import functools
@hsandt
hsandt / set_all_track_numbers_from_name.py
Created Dec 28, 2018
A simple Python script that sets the track number of all (supposedly) audio files found in folder "tracks" based on their respective names
View set_all_track_numbers_from_name.py
#!/usr/bin env python3
# This is a very simple gist based on
# https://stackoverflow.com/questions/8948/accessing-mp3-meta-data-with-python/34970600#34970600
# to add track number metadata to music when the tracks are formatted as "{track_number}_Title.mp3"
# but the track number is missing in metadata.
# This script doesn't check that the file is an mp3, only that the file starts with a number.
# If you need another separator than '_', replace it directly in the script or add a parameter "separator"
# that you would pass to the script.
@hsandt
hsandt / toggle_touchpad_gsettings.py
Created Oct 24, 2018
A Python script that toggles the touchpad for Linux via gsettings. Useful when the toggle touchpad function key doesn't work and vendor-specific command lines do not apply to your computer.
View toggle_touchpad_gsettings.py
#!/usr/bin/python3.6
import sys
import subprocess
gsettings_schema, gsettings_key = "org.gnome.desktop.peripherals.touchpad", "send-events"
def get_touchpad_send_events():
send_events_value = subprocess.check_output(["gsettings", "get", gsettings_schema, gsettings_key])
return send_events_value.strip()
@hsandt
hsandt / CommandLineBuild.cs
Created May 24, 2016
[Unity] C# editor script containing static methods to build a project for Android and iOS
View CommandLineBuild.cs
// Usage: set the projectName you want, then run:
// [Unity executable path] [custom arguments] -executeMethod CommandLineBuild.Build[AndRun][Platform][Development] [-version VERSION]
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Linq;
public class CommandLineBuild
@hsandt
hsandt / buildandrun-ios.sh
Last active Jan 21, 2017
Build and run on a connected iOS device from command-line (even if Unity Editor does not support auto-run for current Xcode version)
View buildandrun-ios.sh
# Platform: OS X
#
# Role: pull last repository changes, then build and run on a connected iOS device
#
# Usage: ./buildandrun-ios.sh [version] [--run-only]
#
# Parameters:
# version version number (e.g. "v0.2", "v4rc3", etc.) for your Unity build name
# --run-only set this if the Unity project was already build and you don't want to rebuild it
#
@hsandt
hsandt / buildandrun-android.sh
Last active May 24, 2016
Build and run a Unity project on a connected Android device from command-line (requires Unix-like shell on Windows)
View buildandrun-android.sh
# Platform: Windows with Unix-like shell (Git Bash recommended)
#
# Role: pull last repository changes, then build and run on a connected Android device
#
# Usage: ./buildandrun-android.sh [version] [--run-only]
#
# Parameters:
# version version number (e.g. "v0.2", "v4rc3", etc.) for your Unity build name
# --run-only set this if the Unity project was already build and you don't want to rebuild it
#
@hsandt
hsandt / GameObjectExtensions.cs
Created May 19, 2016
Unity engine GameObject extensions : get component, instantiate and clone objects
View GameObjectExtensions.cs
public static class GameObjectExtensions {
/// Try to get component of type T, log error if none found
public static T GetComponentOrFail<T>(this GameObject gameObject) where T : Component {
T component = gameObject.GetComponent<T>();
if (component == null)
throw ExceptionsUtil.CreateExceptionFormat("No component of type {0} found on {1}.", typeof(T), gameObject);
return component;
}
@hsandt
hsandt / EditorScreenshot.cs
Created May 15, 2016
An EditorWindow for Unity that captures the exact Game View content
View EditorScreenshot.cs
// Created by Long Nguyen Huu
// 2016.05.15
// MIT License
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
You can’t perform that action at this time.