Skip to content

Instantly share code, notes, and snippets.

@bgr
bgr / VectorSwizzle.cs
Created May 31, 2019 08:48 — forked from grifdail/VectorSwizzle.cs
Vector swizzle in unity
using UnityEngine;
static class Vector2Swizzles {
// swizzle of size 2
public static Vector2 Swizzle_xx(this Vector2 a) { return new Vector2(a.x, a.x); }
public static Vector2 Swizzle_xy(this Vector2 a) { return new Vector2(a.x, a.y); }
public static Vector2 Swizzle_x0(this Vector2 a) { return new Vector2(a.x, 0); }
public static Vector2 Swizzle_x1(this Vector2 a) { return new Vector2(a.x, 1); }
public static Vector2 Swizzle_yx(this Vector2 a) { return new Vector2(a.y, a.x); }
@bgr
bgr / snippets.ly
Last active August 29, 2015 14:16 — forked from tockrock/.ignore
Lilypond snippets
\version "2.12.3"
% =========================
% = Snippetss for Lilypond =
% =========================
%
% snippets.ly
% Basic snippets for Lilypond projects
%
% Created by Takeshi Suzuki on 2010-11-30.