Skip to content

Instantly share code, notes, and snippets.

View zombience's full-sized avatar
:atom:
sorcerous dark arts

Jason Araujo zombience

:atom:
sorcerous dark arts
View GitHub Profile
@zombience
zombience / lifx_onboarding.py
Created May 24, 2021 16:22
Simple python script to send an onboarding packet to a new LIFX bulb. Much faster than using the app to register the bulb and assign it to the appropriate access point.
#
# Author: Tim Serong <tim@wirejunkie.com>
#
# Usage: ./onboard.py <ssid> <password>
#
# This will send an onboarding packet to a virgin LIFX bulb, telling it to
# connect to your local WiFi network using the SSID and password provided
# as command line arguments. There is no error checking, so if it breaks
# you get to keep both pieces.
#
@zombience
zombience / SelectionTrackerWindow.cs
Last active February 26, 2020 00:42
Selection Tracker: track your project and scene selection history. Get back to the last thing you were looking at. Good for large projects.
using UnityEditor;
using UnityEngine;
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using UObject = UnityEngine.Object;
namespace SelectionTracker
{

Keybase proof

I hereby claim:

  • I am zombience on github.
  • I am zombience (https://keybase.io/zombience) on keybase.
  • I have a public key ASCTupBnTCJEB1VQDJl8RSqosgsyJ36zlX05AVFgfSdI3Qo

To claim this, I am signing this object:

@zombience
zombience / spawn_td_minimized.py
Last active August 10, 2018 19:32
snippet used to spawn touch designer minimized - for use from WITHIN touchdesigner to launch a separate instance
import os
import psutil
import subprocess
touch = "{}/TouchDesigner099.exe".format(app.binFolder)
inst = "{}/example_file.toe".format(project.folder)
SW_MINIMIZE = 6
info = subprocess.STARTUPINFO()
info.dwFlags = subprocess.STARTF_USESHOWWINDOW
info.wShowWindow = SW_MINIMIZE
@zombience
zombience / ComponentGrabber.cs
Last active June 28, 2019 21:08
Unity3D: Search for any Components on a given game object, present as selectable object fields
using UnityEngine;
using System.Collections.Generic;
public class ComponentGrabber : MonoBehaviour
{
[SerializeField, HideInInspector]
string searchTerm, filter;
[HideInInspector]
public List<Component> curSelection = new List<Component>();
@zombience
zombience / CustomDebugWindow.cs
Created April 13, 2017 23:38
CustomDebugWIndow is an editor script that provides a way to inspect data, objects, and states over time
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
using System.Collections.Generic;
using System;
// to get this to work, this class musc exist outside "Editor" folder
@zombience
zombience / SimpleTimer.cs
Created July 27, 2016 09:05
SimpleTimer is a bit of code for Unity3D that provides a way to keep track of intervals. It can return time as remaining time, or as a normalized interval (between 0 and 1).
using UnityEngine;
using System.Collections;
public class SimpleTimer
{
public float life { get { return _life; } private set { _life = value; } }
public float elapsed { get { return _curTime; } }
public float normalized { get { return _curTime / life; } } // returns timer as a range between 0 and 1
public float remaining { get { return life - elapsed; } }
public bool isFinished { get { return elapsed >= life; } }
@zombience
zombience / convert_line_endings.py
Last active January 9, 2017 13:29
Convert text files to CRLF or LF line endings. I use code generation via template in Unity, and Unity saves line endings as LF by default. Working in Visual Studio, this creates constant warnings about inconsistent line endings. This is a quick fix. Can be done recursively or only on target directory. Allows for ignored strings.
#! /usr/env python3
import os
import sys
from optparse import OptionParser
#TODO:
# options are getting out of control
# use a config file instead
@zombience
zombience / post-commit.py
Created December 29, 2015 00:48
simple python post-commit hook for slack subversion integration
#! /usr/bin/python
#############################################################
# add a new integration and generate a new token before using with new repo
# https://your_team_name.slack.com/apps/manage/
#############################################################
import os
import sys
@zombience
zombience / pre-commit.py
Last active March 21, 2017 14:26
this is a python script intended for use with unity projects using SVN for version control
#! /usr/bin/python
# This script is intended for use with unity projects using subversion for version control systems
#
# This pre-commit hook will prevent a commit that includes files in the Assets/ folder
# that do not have a companion .meta file.
# Adding asset files without meta files creates a scenario where multiple people
# will have conflicting meta files, causing conflicting settings for imported assets,
# conflicts over who owns the authoritative .meta file, endless confusing notifications about .meta files
# needing to be updated or committed, and generally leads to the dark side.