Skip to content

Instantly share code, notes, and snippets.

View GMadorell's full-sized avatar
🏗️
Building stuff

Gerard Madorell GMadorell

🏗️
Building stuff
View GitHub Profile
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
using System.IO;
using System.Text;
public class EditorFontResizer : EditorWindow {
@wappenull
wappenull / GameViewSizeShortcut.cs
Last active May 29, 2024 09:04
Unity Editor Setting game view resolution by shortcut key
/*
*
* Script to use ALT+1 ALT+2 ALT+3 for setting gameview resolution.
* If shortcut fail (such as 1280x720) you must add it manually in gameview dropdown first.
*
* Author: Wappen
*
* https://gist.github.com/wappenull/668a492c80f7b7fda0f7c7f42b3ae0b0
*
* Revision:
import scala.util.Try
/**
* Alternative to unsound construct: "sealed abstract case class"
* see https://gist.github.com/tpolecat/a5cb0dc9adeacc93f846835ed21c92d2
* The solution below is the summary of the comments of the above gist.
*
* Works as is in Scala 2.12 and higher
* In Scala 2.11.12 you have to add -Xsource:2.12
*/
@travisbrown
travisbrown / cease-and-desist-de-goes.md
Last active July 30, 2020 11:36
Cease and desist letter from John A. De Goes

Please see this response for more context.


Dear Mr. Brown:

We represent the legal interests of our client, Mr. John Arlen De Goes, Maryland, USA.

For several years now, you have repeatedly defamed our client on the internet. Your public blog https://meta.plasm.us/posts/2019/09/01/jdg-and-the-fp-community/ specifically targets our client with the goal to publicly vilify our client. This blog can be easily found with the help of search engines like Google by just searching for the name of our client. On this blog, amongst other false statements, you falsely allege the following about our client:

@jdegoes
jdegoes / zio-test.scala
Last active January 6, 2023 14:08
Simple example of testing with ZIO environment
object test {
import scalaz.zio._
type UserID = String
case class UserProfile(name: String)
// The database module:
trait Database {
val database: Database.Service
@MattRix
MattRix / EmoPacker.cs
Last active May 28, 2024 11:23
Packing a folder of images into a sprite atlas for use with TextMeshPro
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
@gvolpe
gvolpe / CsvApp.scala
Last active July 6, 2023 00:19
CSV file reader using the Fs2 streaming library.
import cats.effect._
import cats.syntax.functor._
import fs2._
import java.nio.file.Paths
import java.util.concurrent.Executors
import scala.concurrent.ExecutionContext
import scala.util.Try
object CsvApp extends IOApp {
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@ditzel
ditzel / MathParabola.cs
Last active February 19, 2024 02:07
A simple Math class to calculate a point in 2D or 3D space lying on a parabola. And a more complex parabola controller that you can put on an object.
using UnityEngine;
using System;
public class MathParabola
{
public static Vector3 Parabola(Vector3 start, Vector3 end, float height, float t)
{
Func<float, float> f = x => -4 * height * x * x + 4 * height * x;
@JcBernack
JcBernack / BigDecimal.cs
Last active June 17, 2024 19:29
BigDecimal
using System;
using System.Numerics;
namespace Common
{
/// <summary>
/// Arbitrary precision decimal.
/// All operations are exact, except for division. Division never determines more digits than the given precision.
/// Source: https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d
/// Based on https://stackoverflow.com/a/4524254