Skip to content

Instantly share code, notes, and snippets.

View JScott's full-sized avatar

Justin Scott JScott

View GitHub Profile
Shader "Custom/BubbleGlow"
{
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_RimColor("Rim Color", Color) = (1, 1, 1, 1)
_RimPower("Rim Power", Range(1.0, 6.0)) = 3.0
}
SubShader {
Tags {
@JScott
JScott / unxip.scpt
Created September 16, 2016 16:41
For unarchiving Apple's bad decisions
-- http://stackoverflow.com/questions/37812664/end-of-central-directory-signature-not-found-when-installing-xcode-8-beta-xip/37857162#37857162
on run argv
tell application "Archive Utility" to open POSIX path of (item 1 of argv)
repeat
delay 5
if application "Archive Utility" is not running then exit repeat
end repeat
end run
Sat Apr 16 2016 11:50:43.306 - //=====================================================================================================================
Sat Apr 16 2016 11:50:43.306 - vrclient startup with PID=8100, config=E:\Steam\config
Sat Apr 16 2016 11:50:43.309 - Not starting vrserver for background application.
Sat Apr 16 2016 11:50:51.948 - //=====================================================================================================================
Sat Apr 16 2016 11:50:51.948 - vrclient startup with PID=13208, config=E:\Steam\config
Sat Apr 16 2016 11:50:51.964 - Starting vrserver process: G:\Steam\steamapps\common\SteamVR\bin\win32\vrserver.exe
Sat Apr 16 2016 11:50:57.037 - Giving up server connection over pipe VR_Pipe after 50 attempts
using UnityEngine;
using System.Collections;
public class CustomFader : MonoBehaviour {
private Material screenMaterial;
public bool startFaded = true;
public float fadeSpeed = 0.5f;
void Awake() {
screenMaterial = GetComponent<Renderer>().material;
@JScott
JScott / TENVER.md
Last active December 23, 2016 10:35
TenVer v10

Ten Versioning v10

Summary

The version of your product is and always will be 10.

Introduction

As you manage a software product, you will have many choices on how to manage the versions of it. Most versioning systems have the following problems:

@JScott
JScott / hide_stdout.rb
Created February 24, 2015 23:27
I always forget how to hide output and logging with RSpec. This worked for me in the past.
module StdoutHelper
def hide_stdout
allow(STDOUT).to receive(:puts)
logger = double('Logger').as_null_object
allow(Logger).to receive(:new).and_return(logger)
end
end
@JScott
JScott / pubsub.js
Last active October 7, 2016 08:39
Like David Walsh's pubsub object but better
/* Improved from http://davidwalsh.name/pubsub-javascript
- Improved readability
- Friendlier naming conventions
- Generic data for publishing
*/
var event: (function(){
var topic = {};
return {
subscribe: function(name, listener) {
It's a bit ugly but this is close to what I use for the mvml.net server right now to serve MVML.
As you can see, it's nothing more than a POST to the server to turn MVML into HTML.
Be careful with the lack of error handling in this code. It's very rough.
These files show example pages that use the hosted MVML API with HTML5 and JS.
Just copy these files onto your page and let the API handle the rest.
You can either edit the MVML in-line or as a separate file.