Skip to content

Instantly share code, notes, and snippets.

View paraself's full-sized avatar
🙆‍♂️
Coding

Yves Wang paraself

🙆‍♂️
Coding
View GitHub Profile
@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.
@keijiro
keijiro / IgnTest.pde
Created March 6, 2015 06:22
Interleaved gradient noise test.
float frac(float x)
{
return x - floor(x);
}
float gradientNoise(float x, float y)
{
float f = 0.06711056f * x + 0.00583715f * y;
return frac(52.9829189f * frac(f));
}
@tsubaki
tsubaki / GizmoUtility.cs
Created January 14, 2015 01:56
Gizmo Utility
using UnityEngine;
using System.Collections;
public class GizmoUtility {
static GUIStyle _guiStyle;
static GUIStyle _GuiStyle
{
get{
if( _guiStyle == null )
@Fonserbc
Fonserbc / Easing.cs
Last active May 27, 2024 09:02
Compact and simple easing functions for Unity
using UnityEngine;
/*
* Most functions taken from Tween.js - Licensed under the MIT license
* at https://github.com/sole/tween.js
* Quadratic.Bezier by @fonserbc - Licensed under WTFPL license
*/
public delegate float EasingFunction(float k);
public class Easing
@ccorcos
ccorcos / symmetric_crypto.coffee
Created November 6, 2014 02:29
AES symmetric encryption crypto node.js
crypto = require "crypto"
key = "this is my password. Make it as long as you want. But its hashed into 512 bytes."
text = "This is the text. as long as you want it"
hash = (utf8String)->
hasher = crypto.createHash('sha512')
hasher.update(utf8String, 'utf8')
hexString = hasher.digest('hex')
return hexString
@bcatcho
bcatcho / SpriteCombiner.cs
Last active July 26, 2021 02:50
Combine Unity3d Sprites
// The MIT License (MIT) - https://gist.github.com/bcatcho/1926794b7fd6491159e7
// Copyright (c) 2015 Brandon Catcho
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.Sprites;
@joecliff
joecliff / cryptojs_base64_encrypt_decrypt.js
Last active March 11, 2024 08:00
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@allanolivei
allanolivei / gist:8982445
Last active March 26, 2022 20:14
Unity 3d : Expose the rendering order of MeshRenderer in the Unity3D
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System;
using UnityEditorInternal;
[CustomEditor(typeof(MeshRenderer)), CanEditMultipleObjects]
public class MeshRendererInspector : Editor
{
@gfsl
gfsl / CompactAttribute.cs
Created August 3, 2013 06:17
[Compact] PropertyDrawer. Makes Vector2, Vector3 and Quaternion display as non-foldouts, like in the default Transform inspector. Attribute in \Attributes, Drawer in \Editor.
using UnityEngine;
using UnityEditor;
public class CompactAttribute : PropertyAttribute {
public CompactAttribute() {}
}
@arjenvanderende
arjenvanderende / invert_mouse_wheel_direction.ps1
Last active January 11, 2024 14:09
Inverting the mouse wheel direction in Windows, to mimic the natural scroll direction of OS X.
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }