Skip to content

Instantly share code, notes, and snippets.

View tylearymf's full-sized avatar
:octocat:

tylearymf tylearymf

:octocat:
  • China
View GitHub Profile
@palmerj
palmerj / xbox_button_names.md
Last active September 20, 2024 04:40
Xbox Controller Button Names and Layout

Buttons

  • RSB == Right Stick Button
  • LSB == Left Stick Button
  • RB == Right Bumper
  • RT == Right Trigger
  • LB == Left Bumper
  • LT == Left Trigger
  • Y == Y Button (Top)
  • A == A Button (Bottom)
using UnityEngine;
public static class Collider2DExtension
{
/// <summary>
/// Return the closest point on a Collider2D relative to point
/// </summary>
public static Vector2 ClosestPoint(this Collider2D col, Vector2 point)
{
GameObject go = new GameObject("tempCollider");
@DanielSWolf
DanielSWolf / Program.cs
Last active September 5, 2024 21:33
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@gafferongames
gafferongames / delta_compression.cpp
Last active July 31, 2024 22:29
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@Kubuxu
Kubuxu / doubleSerialize.lua
Last active July 12, 2024 18:54
Two functions allowing for Lua's number serialization.
--[[
The MIT License (MIT)
Copyright (c) 2015 Jakub (Kubuxu) Sztandera
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is