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
class Reflector | |
{ | |
public static object SetValue(object target, string path, object value) | |
{ | |
Stack<PropertyInfo> s1 = new Stack<PropertyInfo>(); | |
Stack<object> s2 = new Stack<object>(); | |
string[] properties = path.Split('.'); | |
Type type = target.GetType(); |
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
namespace StringExprConverter | |
{ | |
class StringExprConverter | |
{ | |
public static Object Format(String str, Type type) | |
{ | |
if (String.IsNullOrEmpty(str)) | |
return null; | |
if (type == null) | |
return str; |
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
import sys | |
import os | |
import struct | |
#/Tvs_4_0 f:\default.vs | |
root = os.environ['DXSDK_DIR'] | |
file = os.environ['TEMP'] + "output.bin" | |
expr = "\"" + root + "Utilities\\bin\\x86\\fxc.exe\" /Fo" + file | |
if len(sys.argv) >= 2: |
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
def bytes_to_int32(bytes): | |
assert len(bytes) == 4 | |
return sum((b << (k * 8) for k, b in enumerate(bytes))) | |
def MurmurHash64B(data, seed): | |
m = 0x5bd1e995 | |
r = 24 | |
MASK = 0xFFFFFFFF | |
data_as_bytes = bytearray(data) | |
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
PSConstants -> value -> CharID TypeIDToStringID | |
---------- -> ----- -> ------ ---------------- | |
phDialogDontDisplay -> 0 -> | |
phEnumBitDepthA1R5G5B5 -> 825570869 -> "1565" | |
phEnumBitDepthA4R4G4B4 -> 875836468 -> "4444" | |
phEnumAmiga -> 1097688929 -> "Amga" | |
phKeyArrowhead -> 1098019447 -> "Arrw" | |
phEventBackLight -> 1113678668 -> "BacL" | |
phClassBackLight -> 1113680716 -> "BakL" | |
phEnumBitDepth16 -> 1111765302 -> "BD16" |
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
-- Version 1.0.2 | |
set currentStatus to "0" | |
try | |
set currentStatus to do shell script "defaults read com.apple.dock contents-immutable" | |
end try | |
if currentStatus is equal to "0" then | |
tell application "Finder" to display alert "Lock the icons in the Dock?" buttons {"Cancel", "Lock"} | |
else |
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
// Tested on Unity 5.3.5 & Unity 5.5.1 | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditorInternal; | |
using System.Collections; | |
using System.Reflection; | |
[ExecuteInEditMode] | |
public class AnimationWindowHotkeys : Editor | |
{ |
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 System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[ExecuteInEditMode] | |
public class SHLightingProbe : MonoBehaviour |
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
import bpy | |
import gpu | |
from random import random | |
from mathutils import Vector | |
from gpu_extras.batch import batch_for_shader | |
gizmos_line_vert = ''' | |
uniform mat4 u_ViewProjectionMatrix; | |
in vec3 position; | |
in vec4 color; |
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
# porting from https:#github.com/google/spherical-harmonics for blender [WIP] | |
import math, mathutils | |
from random import random, uniform | |
PI = math.pi | |
TWO_PI = 2.0 * PI | |
FACTORIAL_CACHE = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 87178291200, 1307674368000] | |
DOUBLE_FACTORIAL_CACHE = [1, 1, 2, 3, 8, 15, 48, 105, 384, 945, 3840, 10395, 46080, 135135, 645120, 2027025] | |
FACTORIAL_CACHESIZE = 16 |
OlderNewer