Skip to content

Instantly share code, notes, and snippets.

View lihaochen910's full-sized avatar
🏠
Working from home

Kanbaru lihaochen910

🏠
Working from home
View GitHub Profile
@sauy7
sauy7 / commands
Created January 25, 2013 15:20
Example launchd plist file and shell script etc. for debugging the environment when running scripts as a user.
# How to get running and monitor
chmod 777 /Users/username/bin/debug.sh
launchd unload -w /Library/LaunchDaemons/debug.plist
launchd load -w /Library/LaunchDaemons/debug.plist
tail -f /Users/username/tmp/debug.stderr.log
tail -f /Users/username/tmp/debug.stdout.log
@davestewart
davestewart / Convert Selected Elements to Library Items.jsfl
Created March 21, 2013 13:14
Converts selected stage elements to library items, including naming and selecting them in the library. Supports shape objects with multiple members.
/**
* Convert selected elements to library items
* @author Dave Stewart
* @url www.xjsfl.com
*/
// variables
var dom = document, timeline, element, names = [], name;
// create a new movieclip in which to do our conversion
@liortal53
liortal53 / StringLoggingExtensions.cs
Created June 16, 2014 18:32
Unity Debug.Log Helper
using System;
public enum Colors
{
aqua,
black,
blue,
brown,
cyan,
darkblue,
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active July 15, 2024 12:10
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@flibitijibibo
flibitijibibo / FNAWindowExample.cs
Last active April 30, 2022 15:21
Example to hook up an SDL2 window to a Panel for use in a System.Windows.Forms window
#region License
/* FNA GameWindow for System.Windows.Forms Example
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
#endregion
@davidruhmann
davidruhmann / EventParams.cs
Last active March 1, 2023 22:03
C# Dynamic EventArgs
// Copyright (c) 2015 David Ruhmann
using System;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace ChartedCode
{
@HelloKitty
HelloKitty / Quaternion.cs
Last active July 12, 2024 02:23 — forked from JakubNei/MyQuaternion.cs
A custom completely managed implementation of UnityEngine.Quaternion. Base is decompiled UnityEngine.Quaternion. Doesn't implement methods marked Obsolete. Does implicit coversions to and from UnityEngine.Quaternion
// A custom completely managed implementation of UnityEngine.Quaternion
// Base is decompiled UnityEngine.Quaternion
// Doesn't implement methods marked Obsolete
// Does implicit coversions to and from UnityEngine.Quaternion
// Uses code from:
// https://raw.githubusercontent.com/mono/opentk/master/Source/OpenTK/Math/Quaternion.cs
// http://answers.unity3d.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html
// http://stackoverflow.com/questions/12088610/conversion-between-euler-quaternion-like-in-unity3d-engine
// http://stackoverflow.com/questions/11492299/quaternion-to-euler-angles-algorithm-how-to-convert-to-y-up-and-between-ha
@tsubaki
tsubaki / Sample.cs
Last active December 23, 2020 08:22
アニメーションの終了を待つ奴
using UnityEngine;
using System.Collections;
public class Sample : MonoBehaviour
{
private static readonly int hashAttack = Animator.StringToHash("Attack");
private static readonly int hashIdle = Animator.StringToHash("Idle");
[SerializeField]
UnityEngine.UI.Text text;
@wh1t3p1g
wh1t3p1g / ctf古典密码集合
Last active March 26, 2024 05:51
古典密码集合
下述密码均摘自互联网
【字母表顺序】-数字 
  加密的时候,经常要把A~Z这26个字母转换成数字,最常见的一种方法就是取字母表中的数字序号。A代表1,B代表2,C代表3... 
  字母 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
  数字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 
@MattRix
MattRix / ExportFlashLibraryAsUnitySpritesheet.jsfl
Last active January 6, 2020 08:51
Export assets from a Flash fla as a spritesheet and automatically repopulate the Unity atlas metadata with the correct sprite dimensions
//http://help.adobe.com/en_US/flash/cs/extend/index.html
var outputScaleFactor = 1;
var libraryFolderName = "Export";
var shouldExportSubfolderNames = true;
main();
function main()