Skip to content

Instantly share code, notes, and snippets.

View DaveVoyles's full-sized avatar

Dave Voyles DaveVoyles

View GitHub Profile
@fadookie
fadookie / CameraAnchor.cs
Last active April 29, 2024 12:19
Screen-relative anchoring component for Unity3D. Find more Unity code at http://www.eliotlash.com/2015/01/unity3d-components-and-code-snippets/
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
* It is also copied in this gist below.
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)