$ curl --header "X-Forwarded-For: #.#.#.#" 'http://targetpost.url' --data 'your=1&data=2&here=ok'
This file contains hidden or 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
// perspective camera, get far clip plane edges in world space (z is set to 0) | |
var bottomLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, 0, cam.farClipPlane)); | |
var topLeft = (Vector2)cam.ScreenToWorldPoint(new Vector3(0, cam.pixelHeight, cam.farClipPlane)); | |
var topRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, cam.pixelHeight, cam.farClipPlane)); | |
var bottomRight = (Vector2)cam.ScreenToWorldPoint(new Vector3(cam.pixelWidth, 0, cam.farClipPlane)); | |
Debug.DrawLine(bottomLeft, topLeft, Color.red, 33); | |
Debug.DrawLine(topLeft, topRight, Color.green, 33); | |
Debug.DrawLine(topRight, bottomRight, Color.blue, 33); | |
Debug.DrawLine(bottomRight, bottomLeft, Color.magenta, 33); |
This file contains hidden or 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
void Update () { | |
Debug.Log(FormatTime(Time.time)); | |
} | |
string FormatTime(float t) | |
{ | |
var time = System.TimeSpan.FromSeconds(t); | |
return string.Format("{0:D2}:{1:D2}:{2:D3}", time.Minutes, time.Seconds, time.Milliseconds); | |
} |
This file contains hidden or 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
// ==UserScript== | |
// @name LudumDareThemeSlaughterKeyboard | |
// @namespace unitycoder.com | |
// @description use arrowkeys to vote | |
// @include http://ludumdare.com/theme/* | |
// @include http://www.ludumdare.com/theme/* | |
// @version 1.3 | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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; | |
public class SetSortingOrderAndLayer : MonoBehaviour { | |
public int sortingOrder = 0; | |
public string layerName = "Default"; | |
void Awake() | |
{ | |
GetComponent<Renderer>().sortingOrder = sortingOrder; |
This file contains hidden or 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
// https://github.com/genekogan/Processing-Shader-Examples/blob/master/TextureShaders/data/threshold.glsl | |
float bright = 0.33333 * (color.r + color.g + color.b); | |
float b = lerp(0.0, 1.0, step(0.1, bright)); |
This file contains hidden or 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 url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain("answers.unity3d.com") | |
{ | |
/* http://unitycoder.com/blog/2015/08/25/unity-answers-custom-css-style/ */ | |
/* --------------- page --------------- */ | |
/* page padding */ | |
.main{ | |
padding: 0px !important; |
This file contains hidden or 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
// loops only first level | |
foreach (Transform child in transform) | |
{ | |
Debug.Log(child.name); | |
} | |
// loop all recursive https://forum.unity.com/threads/loop-through-all-children.53473/#post-340519 | |
void TraverseHierarchy(Transform root) | |
{ | |
for (Transform child in root) { |
This file contains hidden or 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
static int _myNumber; | |
public static int MyNumber | |
{ | |
get | |
{ | |
// add custom logic here when value is queried | |
return _myNumber; | |
} | |
set | |
{ |