Skip to content

Instantly share code, notes, and snippets.

@capnslipp
capnslipp / Matrix4x4Extensions.cs
Last active August 29, 2015 13:56
Fix for Unity3D's broken Matrix4x4.isIdentity
/// @usage: Use as you would a native Matrix4x4 method;
/// e.g. `this.transform.localToWorldMatrix.IsActuallyIdentity()`
/// @usage: Lives best within `Assets/Plugins/`.
using UnityEngine;
public static class Matrix4x4Extensions
{
using UnityEngine;
using System.Collections;
public class OrderTester : MonoBehaviour {
void Update() { Debug.Log("Update()"); }
void LateUpdate() { Debug.Log("LateUpdate()"); }
void FixedUpdate() { Debug.Log("FixedUpdate()"); }
void Awake() { Debug.Log("Awake()"); }
void Start() { Debug.Log("Start()"); }
void Reset() { Debug.Log("Reset()"); }
// @source: https://gist.github.com/darktable/2018687#file-guiscaler-cs
using System;
using System.Collections;
using UnityEngine;
/// Usage:
/// (optional) Call GUIScaler.Initialize() in Start(), Awake() or OnEnable() (only needed once)
#import "TestCGBitmapContextCreate_iOSTests.h"
@implementation TestCGBitmapContextCreate_iOSTests
- (void)setUp
{
[super setUp];
@capnslipp
capnslipp / Texture Stepped.glsl.shader
Created August 23, 2014 08:10
Fragment-phase texture point-filtering, as a Unity GLSL shader
/// @creator: Slipp Douglas Thompson
/// @license: WTFPL
/// @why: Too trivial to care.
/// @intersource: https://gist.github.com/capnslipp/02536fd06afe9428c381
Shader "Texture Stepped" {
Properties {
_MainTex ("Base (RGBA)", 2D) = "gray" {}
_Step ("Step (XY)", Vector) = (32, 32, 0, 0)
}
@capnslipp
capnslipp / cssarrowsplease.less
Created October 22, 2014 07:32
An attempt to port cssarrowplease.com to a Less mixin in order to make the if/else approach in http://hugogiraudel.com/2012/11/13/less-to-sass/ look dumb
@arrow_box_size: 30px;
@arrow_box_color: #88b7d5;
@arrow_box_border_width: 4px;
@arrow_box_border_color: #c2e1f5;
.arrow_box {
position: relative;
background: @arrow_box_color;
border: @arrow_box_border_width solid @arrow_box_border_color;
&:after, &:before {
#!/usr/local/bin/node
var https = require('https');
var token, username;
var tenxer = 'tenxer';
var shitsFucked = 0;
var shitsUnfucked = 0;
var reposCount = 0;
process.argv.forEach(function (arg) {
@capnslipp
capnslipp / gist:716149
Created November 26, 2010 01:14
HTML Special Characters - Quick-Access Sheet
<dl>
<dt>emsp:</dt><dd><textarea>&emsp;</textarea></dd>
</dl>
@capnslipp
capnslipp / index.html
Last active September 24, 2015 14:58
First Revision of 6bitt.com (2002-11-30)
<HTML>
<HEAD>
<TITLE>YOUR DUMB!!! STOMP STOMP!!</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
   <TR>
       <TD colspan="2" height="100%" align="center" valign="center">
           <CENTER>
@capnslipp
capnslipp / gist:1186489
Created September 1, 2011 15:55
RegExp'ing in JSON
var endOfScopeMarker = '\t\t},';
var find = new RegExp('"someProperty" : 3((?:(?!'+endOfScopeMarker+').|\n)+)("anotherPropertyWithinTheSameScope" : 1,)', "g");
var replace: '"someProperty" : 0$1$2';