Skip to content

Instantly share code, notes, and snippets.

View EricBatlle's full-sized avatar

Eric Batlle EricBatlle

  • Barcelona, Spain
View GitHub Profile
@granoeste
granoeste / EachDirectoryPath.md
Last active November 4, 2024 06:16
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active October 19, 2024 04:37
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;

LaTeX: preventing text from overflowing into margins

There are multiple approaches one could take.

Explicit breaks inside \texttt{}

@mrkmg
mrkmg / TimeSpanExtensions.cs
Last active October 24, 2024 21:24
C# .NET TimeSpan Rounding and Display
using System;
namespace Utils {
public static class TimeSpanExtensions
{
public static TimeSpan Round(this TimeSpan span, TimeSpanRoundingType type, MidpointRounding mode = MidpointRounding.ToEven) =>
type switch
{
TimeSpanRoundingType.QuarterMinute => TimeSpan.FromSeconds(Math.Round(span.TotalSeconds / 15, 0, mode) * 15),
@binouze
binouze / AutoUpdater.cs
Last active June 2, 2023 03:26
Simplest implementation of Android in-app updates for Unity
using System;
using UnityEngine;
public sealed class AutoUpdater : MonoBehaviour
{
private const string AndroidClass = "com.lagoonsoft.AutoUpdater";
#region static Singleton
private static AutoUpdater _instance;
private static AutoUpdater GetInstance()
#!/bin/sh
# e.g. CONTAINER_REGISTRY=asia.gcr.io/your-project-name/gcf/asia-northeast1
CONTAINER_REGISTRY=`WRITE YOUR REGISTRY NAME`
IMAGE_LIST=`gcloud container images list --repository=$CONTAINER_REGISTRY | awk 'NR!=1'`
for line in $IMAGE_LIST; do
gcloud container images delete "$line/worker" --quiet & gcloud container images delete "$line/cache" --quiet &
done
@jamiephan
jamiephan / README.md
Last active November 14, 2024 23:02
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com