Skip to content

Instantly share code, notes, and snippets.

View atamocius's full-sized avatar
😜

Anton Mata atamocius

😜
View GitHub Profile
@baruchadi
baruchadi / DrowsyLogger.cs
Last active February 12, 2024 12:30
useful Debug.log extensions
using System;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Utils
{
public static class DrowsyLogger
{
public static string Color(this string myStr, string color)
{
@EmilyRosina
EmilyRosina / jsconfig.json
Created November 13, 2020 20:46
VSCode config to get CTRL + click and Class intellisense working everywhere
{
// This file is required for VSCode to understand webpack aliases
"module": "es6",
"moduleResolution": "node",
"compilerOptions": {
"resolveJsonModule": true,
"jsx": "preserve",
"module": "commonjs",
"target": "es5",
"sourceMap": true,
@jhorikawa
jhorikawa / VertexColor.shader
Created January 15, 2018 18:39
Unity Shader to visualize vertex color.
Shader "Custom/VertexColor" {
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert vertex:vert
#pragma target 3.0
struct Input {
@posener
posener / go-function-error-reporting.md
Last active February 12, 2024 05:32
Function Failure reporting: Error or OK

Function Failure Reporting: Error or OK

Go's "multiple return values" feature, can be used for several purposes. Among them for failure reporting to the function caller. Go has two conventions for failure reporting, but currently, no clear convention for which to use when. I've encountered different programmers that prefer different choices in different cases. In this article, we will discuss the two, and try to make the process of choosing our next function signature more conscious.

The Basics

@petersirka
petersirka / parser-transform.js
Created March 19, 2017 22:15
Parse transform SVG attribute
String.prototype.parseTransform = function() {
var prop = ['translate', 'matrix', 'rotate', 'skewX', 'skewY', 'scale'];
var val = this.match(/(translate|matrix|rotate|skewX|skewY|scale)\(.*?\)/g);
var obj = {};
if (val) {
for (var i = 0, length = val.length; i < length; i++) {
var item = val[i];
var index = item.indexOf('(');
var v = item.substring(index + 1, item.length - 1).split(/\,|\s/);
var n = item.substring(0, index);
@cjddmut
cjddmut / EasingFunctions.cs
Last active May 3, 2024 13:31
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* 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
@coolaj86
coolaj86 / github-pages-https-lets-encrypt.md
Last active November 16, 2021 22:36
Github Pages: Let's Encrypt!
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@keijiro
keijiro / ExpEase.cs
Created April 28, 2011 23:02
Exponential easing out utility for Unity
// Example:
//
// currentPos = ExpEase.Out(currentPos, targetPos, -4.0);
//
// or
//
// ExpEase.Out2(currentPos, targetPos, -4.0); // This modifies currentPos.
//
using UnityEngine;