Skip to content

Instantly share code, notes, and snippets.

View omgwtfgames's full-sized avatar

Andrew Perry omgwtfgames

View GitHub Profile
@omgwtfgames
omgwtfgames / tweet_3079.py
Last active October 13, 2015 20:08
Tailing a log file and tweeting events (3079 server example)
#!/usr/bin/env python
import sys, time, datetime
dont_actually_tweet = False
twitter_account_name = "3079.omgwtfgames.com"
logfilename = '/tmp/3079.log'
consumer_key=""
consumer_secret=""
@omgwtfgames
omgwtfgames / monetize.py
Last active December 31, 2015 03:08
A simple Python CGI script for producing permission forms for Let's Players
<h1>OMGWTFGAMES !1!! Let's Players</h1>
<h1>"moolah for the viddya" permission form</h1>
<form method="get" action="monetize.py">
<table><tr>
<td>Your name:</td><td><input type="text" name="name"></td>
</tr>
<tr>
<td>The game you've made a video of (optional):</td><td><input type="text" name="game"></td>
</tr>
</table>
@omgwtfgames
omgwtfgames / NoiseTexture.cs
Last active March 17, 2021 00:18 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise function based on the Simplectic honeycomb - C# port
/*
* OpenSimplex (Simplectic) Noise Test for Unity (C#)
* This file is in the Public Domain.
*
* This file is intended to test the functionality of OpenSimplexNoise.cs
* Attach this script to a GameObject with mesh (eg a Quad prefab).
* Texture is updated every frame to assist profiling for performance.
* Using a RenderTexture should perform better, however using a Texture2D
* as an example makes this compatible with the free version of Unity.
*
@omgwtfgames
omgwtfgames / ShuffleListExtensions.cs
Last active June 18, 2016 06:24
Extension methods to shuffle a list in place, or return a random item
using System;
using System.Collections;
using System.Collections.Generic;
public static class ShuffleListExtensions {
/// <summary>
/// Shuffle the list in place using the Fisher-Yates method.
/// </summary>
/// <typeparam name="T"></typeparam>
@omgwtfgames
omgwtfgames / A set of Unity3D extension methods
Last active March 2, 2024 17:44
Some useful extension method for Unity3D
A collection of useful C# extension methods for the Unity engine.
@omgwtfgames
omgwtfgames / UnlitColoredDoubleSided.shader
Created November 13, 2015 01:03
UnlitColoredDoubleSided.shader
Shader "Unlit Colored Double Sided" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
Category {
Lighting Off
ZWrite On
Cull Off
SubShader {
@omgwtfgames
omgwtfgames / cardboardcam_extract.py
Last active February 8, 2021 11:05
Extracts the audio and second image from a Cardboard Camera panoramic image
#!/usr/bin/env python
#
# Google Cardboard Camera extractor
# Extracts audio and second image from the XMP header in Cardboard Camera images
# Requires python-xmp-toolkit ( pip install python-xmp-toolkit )
#
# Usage:
# $ carboardcam_extract.py myimage_vr.jpg
#
# Creates two new files - myimage_vr_audio.mp4 and myimage_vr_righteye.jpg
@omgwtfgames
omgwtfgames / StareButton.cs
Created April 22, 2016 01:01 — forked from flarb/StareButton.cs
This is a 'stare button' for Google Cardboard apps where you just want to stare at a button over time to select it.
using System;
using System.Reflection;
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
public class StareButton : MonoBehaviour, IEventSystemHandler, IPointerExitHandler, IPointerEnterHandler, ISelectHandler {
@omgwtfgames
omgwtfgames / VRInputModule.cs
Created April 22, 2016 01:01 — forked from flarb/VRInputModule.cs
Lets you use a VR world space cursor with World Space Canvases in Unity3D 4.6. Add this to the EventSystem object. Put some box colliders on your buttons in the World Space Canvas. Then, do a trace to see if you're looking at a menu object--if the trace hits one of those buttons, pass it to SetTargetObject. See ralphbarbagallo.com for a longer e…
using UnityEngine;
using UnityEngine.EventSystems;
//by Ralph Barbagallo
//www.flarb.com
//www.ralphbarbagallo.com
//@flarb
public class VRInputModule : BaseInputModule {
@omgwtfgames
omgwtfgames / LetterSpacing.cs
Last active April 24, 2016 01:25 — forked from tommycutter/LetterSpacing.cs
Letter Spacing Component for Unity 5.3, 5.4
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
http://forum.unity3d.com/threads/adjustable-character-spacing-free-script.288277/
Unity 5.1 and 5.2.2+ compatible
Produces an simple tracking/letter-spacing effect on UI Text components.