Skip to content

Instantly share code, notes, and snippets.

View agarcialeon's full-sized avatar
🤷‍♂️
Living the digital diogenes syndrome.

Álvaro García León agarcialeon

🤷‍♂️
Living the digital diogenes syndrome.
View GitHub Profile
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
@javierav
javierav / turbolinks.md
Created August 17, 2020 07:20
Introducción a Turbolinks
@Nimrodda
Nimrodda / glide_v3_to_v4_cheatsheet.md
Last active February 5, 2021 15:34
Glide migration from v3 to v4 cheatsheet

Glide v3 Migration to v4 Cheatsheet

Description V3 V4
Entry point - optional unless you have a custom GlideModule Glide GlideApp
Bitmap transformations bitmapTransform() transform()
Release bitmap Glide.clear() GlideApp.with(context).clear()
Custom animations animate(android.R.anim.fade_in) transition(GenericTransitionOptions.with(android.R.anim.fade_in))
Request builder DrawableRequestBuilder<CustomModel> RequestBuilder<Drawable>
Request builder DrawableRequestBuilder<String> RequestBuilder<Drawable>
@quaternioninterpolation
quaternioninterpolation / ImageDOCrossfade.cs
Last active October 7, 2025 09:35
DOTween UnityEngine.UI.Image image cross fade
/** --
** Copyright (C) 2019 by Josh van den Heever
**
** 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 furnished to
** do so, subject to the following conditions:
**
@PixelScream
PixelScream / GravityWarp.shader
Created March 28, 2018 21:24
Gravity Warp Shader
Shader "Unlit/GravityWarp"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags {
"RenderType"="Opaque"
@omikun
omikun / autoSuspendUnity.py
Created March 2, 2018 07:09
Monitors current window under focus and suspends Unity when it is not in focus in order to save battery life
#!/usr/bin/ python
''' This script automatically finds PIDs for Unity
and suspend those processes whenever Unity is not in focus.
This script is meant to stay running and polls window focus every 1 second
Written March 1st, 2018 by Omikun, compiled from StackOverflow answers:
Identify window under focus:
https://superuser.com/questions/734007/how-do-i-tell-which-app-stole-my-focus-in-os-x
Get PID by process name
@mbinna
mbinna / effective_modern_cmake.md
Last active October 28, 2025 09:48
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@Hotrian
Hotrian / SpriteResizer.cs
Last active July 13, 2018 08:12
Automatically Scales Sprite Texture2Ds, allowing you to multiply the image size safely, and effectively. Not guaranteed to work on every Sprite, or at all for that matter :P.
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/* Unity Sprite Resizer v1.6 © Hotrian 2017
*
* This has only been tested on PNG files.
*
* Usage instructions:
@yagero
yagero / UtilsEnum.cs
Created August 28, 2017 09:48
Enum.HasFlag in .NET 2 / Unity 5
public static class UtilsEnum
{
public static bool HasFlag(this Enum mask, Enum flags) // Same behavior than Enum.HasFlag is .NET 4
{
#if DEBUG
if (mask.GetType() != flags.GetType())
throw new System.ArgumentException(
string.Format("The argument type, '{0}', is not the same as the enum type '{1}'.",
flags.GetType(), mask.GetType()));
#endif