Skip to content

Instantly share code, notes, and snippets.

View yosun's full-sized avatar
:octocat:
cal.permute.xyz

yosun

:octocat:
cal.permute.xyz
View GitHub Profile
@mandarinx
mandarinx / FullscreenPlayMode.cs
Created June 23, 2016 21:53
Fullscreen game view in Unity
using UnityEditor;
using UnityEngine;
using System.Collections;
[InitializeOnLoad]
public class FullscreenPlayMode : MonoBehaviour {
//The size of the toolbar above the game view, excluding the OS border.
private static int tabHeight = 22;
@mickdekkers
mickdekkers / SnapshotCamera.cs
Last active May 14, 2024 11:26
Take snapshot images of Prefabs and GameObjects in Unity using Render Textures
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
// Object rendering code based on Dave Carlile's "Create a GameObject Image Using Render Textures" post
// Link: http://crappycoding.com/2014/12/create-gameobject-image-using-render-textures/
@solariz
solariz / alexa_skill_example.php
Last active November 9, 2019 00:30
Amazon Echo / Alexa Intent example in PHP with Security validation
<?php
/* This is a simple PHP example to host your own Amazon Alexa Skill written in PHP.
In my Case it connects to my smarthome Raspberry pi Cat Feeder with two intents;
1: Dispense Food to the cats.
2: When did the Feeder last time feed the cats? Return a spoken time / date
This Script contains neccessary calls and security to give you a easy to use DIY example.
v2016.12.29
Details in my Blogpost: https://solariz.de/de/amazon-echo-alexa-meets-catfeeder.htm
*/
@threepointone
threepointone / alternative.md
Last active July 31, 2022 17:46
list of things that don't do what they say they do

(also know as lies and/or alternative facts)

js

  • setImmediate - doesn't set anything immediately, waits for a tick before executing
  • setTimeout(fn, n) - never sets the timeout to exactly n
  • Math.random() - computers cannot generate random numbers
  • Promise - is a lie when rejected
  • Array.reduce - accumulates, does not reduce (via @sbmadhav)
@paulhayes
paulhayes / Sun.cs
Last active May 14, 2024 22:45
Rotates a Unity directional light based on location and time. Includes time scale, and frame stepping for continuous use.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Entropedia
{
[RequireComponent(typeof(Light))]
[ExecuteInEditMode]
@jhorikawa
jhorikawa / Scanner.cs
Created January 22, 2018 17:27
Unity script for document scanning using OpenCVForUnity.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using OpenCVForUnity;
public class Scanner : MonoBehaviour {
public Texture2D baseTexture;
public RawImage sourceRawImage;
public RawImage targetRawImage;
@vad710
vad710 / AnchorTargetListener.cs
Last active March 12, 2022 16:49
Class that takes the content from a Vuforia Image target and puts it inside of a ground plane stage
using UnityEngine;
using Vuforia;
public class AnchorTargetListener : MonoBehaviour, ITrackableEventHandler
{
//The Goal of this class is to automatically Initiate a Ground Plane when the Image Target is detected
// Use this classs in combination with the PlaceContentFromImageTarget if you want to move the content
// of an image target onto the Ground Plane Stage
@Oranzh
Oranzh / AES-256 encryption and decryption in PHP and C#.md
Created March 24, 2018 04:19
AES-256 encryption and decryption in PHP and C#

AES-256 encryption and decryption in PHP and C#

Update: There is a more secure version available. Details

PHP

<?php

$plaintext = 'My secret message 1234';
@olokobayusuf
olokobayusuf / MultiCameraInput.cs
Last active April 9, 2020 03:54
Pseudocode example illustrating recording multiple game cameras with NatCorder.
/*
* NatCorder
* Copyright (c) 2019 Yusuf Olokoba
*/
namespace NatCorder.Inputs {
using UnityEngine;
using System;
using Clocks;
@vmchar
vmchar / ReplaceDelegatePostProcess.cs
Created November 17, 2018 20:46
Unity3D iOS post build process to replace app delegate source
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
namespace QuickActionsiOS
{
public class ReplaceDelegatePostProcess : ScriptableObject
{
/// <summary>