Skip to content

Instantly share code, notes, and snippets.

View hiepnd's full-sized avatar

Ngo Duc Hiep hiepnd

  • No Power-up
  • Ha Noi, Viet Nam
View GitHub Profile
Shader "Screw/Texture Flat" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
}
SubShader {
Tags { "RenderType"="Opaque" "Queue" = "Geometry"}
LOD 200
Pass {
@hiepnd
hiepnd / PriorityList.cs
Created November 5, 2016 07:21
C# Priority List
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class PriorityList<T> : IEnumerable<T> where T : IComparable<T> {
private List<T> data;
public PriorityList() {
this.data = new List<T>();
TransformState p0, p1;
void Update2 (Transform transform, float dt) {
time += dt;
if (time < playOutDelay)
return;
if (!interpolating) {
if (buffer.Count >= 1) {
p0 = buffer [0];
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEngine.UI;
[CustomEditor(typeof(JSDebugNode))]
public class DebugNodeEditor : Editor {
public override void OnInspectorGUI ()
#pragma strict
import UnityEngine.UI;
import UnityEngine;
public var code:String = "// Type your JS code here\n// Predefined variables:\n// _S: this component\n// _GO: this game object\n\nprint('Hello world');\n\n";
function Eval(str:String) {
var _GO = this.gameObject;
var _S = this;
var _T = this.transform;
@hiepnd
hiepnd / ScreenSpaceUVMap.shader.cpp
Created July 20, 2016 08:46
Screen Space UV Map
Shader "Screw/Custom Shadow" {
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_Factor ("Factor", Float) = 0.0125
_Shift ("UV Shift", Float) = 0.5
_Rotation ("Rotation", Float) = 0
}
CGINCLUDE
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D PYTHON2_PACKAGES_PATH=/usr/local/lib/python2.7/site-packages \
-D PYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin \
-D PYTHON2_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Headers \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D BUILD_DOCS=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
@hiepnd
hiepnd / CourseraSpider.py
Last active March 6, 2016 12:26
Just for fun!
import scrapy
import os
import urllib
from threading import Thread
from Queue import Queue
from multiprocessing import Pool
import time
class CourseraSpider(scrapy.Spider):
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(MeshModifier))]
public class MeshModifierEditor : Editor {
public override void OnInspectorGUI ()
{
DrawDefaultInspector();
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class MeshCombine : MonoBehaviour {
const float EPSILON = 0.01f;