This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. | |
# | |
import ctypes | |
import logging | |
import os | |
class ColorizingStreamHandler(logging.StreamHandler): | |
# color names to indices | |
color_map = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lack of tail call optimization in JS | |
var sum = function(x, y) { | |
return y > 0 ? sum(x + 1, y - 1) : | |
y < 0 ? sum(x - 1, y + 1) : | |
x | |
} | |
sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
// Using workaround |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are snippets of py.test in action, used in a talk given at | |
PyCon AU 2012 in Hobart, Tasmania. They are all relevant for | |
py.test 2.2 except where specified. Where taken from open source | |
projects I have listed a URL, some examples are from the py.test | |
documentation, some are from my workplace. | |
Apart from things called test_*, these functions should probably | |
be in your conftest.py, although they can generally start life in | |
your test files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System; | |
using System.Linq; | |
using System.Reflection; | |
[InitializeOnLoad] | |
public class RXLookingGlass | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/* | |
Copyright 2016 Max Kaufmann (max.kaufmann@gmail.com) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ($xml, $xsl, $output) | |
if (-not $xml -or -not $xsl -or -not $output) | |
{ | |
Write-Host "& .\Transform-Xslt.ps1 [-xml] xml-input [-xsl] xsl-input [-output] transform-output" | |
exit; | |
} | |
trap [Exception] | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Used to draw custom inspectors for unrecognised file types, which Unity imports as "DefaultAsset" | |
/// To do this, create a new editor class extending DefaultAssetInspector | |
/// Return true in the IsValid function if the file extension of the file matches the type you'd like to draw. | |
/// The DefaultAssetEditor class will then hold a reference to the new instance of your editor class and call the appropriate methods for drawing. | |
/// An example can be found at the bottom of the file. | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem update-unity-compiler.cmd | |
@rem start in */com.unity.incrementalcompiler@X.Y.ZZ folder | |
@echo off | |
@rem NOTE: FIND.EXE can clash with git/msys/cygwin's find | |
for %%a in (%ComSpec%) do set __system=%%~dpa | |
%__system%FIND.EXE /i "com.unity.incrementalcompiler" package.json 1> NUL | |
if %errorlevel% neq 0 goto :not_found | |
nuget install Microsoft.Net.Compilers -verbosity quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
static class Vector2Swizzles { | |
// swizzle of size 2 | |
public static Vector2 Swizzle_xx(this Vector2 a) { return new Vector2(a.x, a.x); } | |
public static Vector2 Swizzle_xy(this Vector2 a) { return new Vector2(a.x, a.y); } | |
public static Vector2 Swizzle_x0(this Vector2 a) { return new Vector2(a.x, 0); } | |
public static Vector2 Swizzle_x1(this Vector2 a) { return new Vector2(a.x, 1); } | |
public static Vector2 Swizzle_yx(this Vector2 a) { return new Vector2(a.y, a.x); } |
OlderNewer