Skip to content

Instantly share code, notes, and snippets.

View ziriax's full-sized avatar

Peter Verswyvelen ziriax

View GitHub Profile
@ziriax
ziriax / drag.cs
Created August 30, 2020 18:46
Unity3D mouse to canvas position (dragging item on canvas)
using UnityEngine;
public class MouseDrag : MonoBehaviour
{
void Update()
{
if (Input.GetMouseButton(0))
{
var canvas = transform.root.GetComponent<Canvas>();
var canvasRect = canvas.GetComponent<RectTransform>();
@ziriax
ziriax / .ps1
Created August 6, 2020 13:26
git reset hard all subfolders (not submodules)
Get-ChildItem -Recurse -Include ".git" -Hidden -Directory | %{pushd "$_\.." ; git reset --hard; popd }
@ziriax
ziriax / index.html
Last active December 7, 2019 11:05 — forked from DerekZiemba/index.html
ES6 Classes vs Closures vs ES5 "Classes" (http://jsbench.github.io/#68b5db1b478dbb447abec7af4dd2af51) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>ES6 Classes vs Closures vs ES5 "Classes"</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{