Skip to content

Instantly share code, notes, and snippets.

View mstevenson's full-sized avatar

Michael Stevenson mstevenson

View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@fossil12
fossil12 / C.sublime-build
Created January 15, 2014 19:50
Sublime Text 2 Build System for C on OS X. (Just move/copy file to `Packages/User`.)
{
"cmd": ["gcc", "${file}", "-o", "${file_path}/${file_base_name}", "-Wall"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c",
"variants":
[
{
"name": "Run",
@capnslipp
capnslipp / SerializedPropertyValueExtension.cs
Last active June 18, 2023 19:45
Genericized #Unity3D SerializedProperty value access, an extension that should be part of the API.
/// @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;
@krry
krry / os-x-for-hackers
Last active January 15, 2021 05:54 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers mods
# to run this script in one step, copy/paste/execute the following:
# bash <(curl -s https://gist.githubusercontent.com/krry/9263570/raw/878797c4e54f9de71137699544567c6bd2d4f6c4/os-x-for-hackers)
#!/usr/bin/env bash
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
sudo -v
@fredrikaverpil
fredrikaverpil / maya_sublime.py
Created March 25, 2014 14:58
Open ports in Maya for Sublime Text #maya
import maya.cmds as cmds
# Close ports if they were already open under another configuration
try:
cmds.commandPort(name=":7001", close=True)
except:
cmds.warning('Could not close port 7001 (maybe it is not opened yet...)')
try:
cmds.commandPort(name=":7002", close=True)
except:
@natelandau
natelandau / .bash_profile
Last active March 20, 2024 22:19
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
class DataBuffer {
var internalData: NSData;
init(fromData: NSData) {
self.internalData = NSData.dataWithData(fromData) as NSData;
}
init(fromFilePath: String) {
self.internalData = NSData.dataWithContentsOfFile(fromFilePath, options: .DataReadingMappedIfSafe, error: nil) as NSData;
}
@lexrus
lexrus / disable_all_animation.sh
Created August 1, 2014 06:05
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
@neon-izm
neon-izm / GameWindowMover.cs
Created August 13, 2014 08:31
unity editor script: UnityEditor GameView automatically move to "Rift DK2 Extend Display"
using UnityEngine;
using UnityEditor;
//Version 0.21 | twitter:@izm update for DK2
//Version 0.2 | s.b.Newsom Edition
//Source from http://answers.unity3d.com/questions/179775/game-window-size-from-editor-window-in-editor-mode.html
//Modified by seieibob for use at the Virtual Environment and Multimodal Interaction Lab at the University of Maine.
//Use however you'd like!
@stramit
stramit / CustomEvents.cs
Created September 4, 2014 06:16
Sending Custom Events via the EvenSystem
using System;
using System.Collections.Generic;
using UnityEngine.Events;
// interface you implement in your MB to receive events
public interface ICustomHandler : IEventSystemHandler
{
void OnCustomCode(CustomEventData eventData);
}