Skip to content

Instantly share code, notes, and snippets.

View jeremedia's full-sized avatar

Jeremy Roush jeremedia

View GitHub Profile
@kyrylo
kyrylo / colorized_logger.rb
Last active November 9, 2024 16:06
Nice colorized logs for Rails apps! With this initializer, you can instantly colorize your Rails development logs. Just copy and paste the code, and it’ll work. https://x.com/kyrylosilin/status/1852308566201237815
# frozen_string_literal: true
# config/initializers/colorized_logger.rb
# This initializer adds color to the Rails logger output. It's a nice way to
# visually distinguish log levels.
module ColorizedLogger
COLOR_CODES = {
debug: "\e[36m", # Cyan
info: "\e[32m", # Green
warn: "\e[33m", # Yellow
@keijiro
keijiro / FpsCapper.cs
Last active November 5, 2024 06:53
FpsCapper - Limits the frame rate of the Unity Editor in Edit Mode
using UnityEditor;
using UnityEngine;
using UnityEngine.LowLevel;
using System.Linq;
using System.Threading;
namespace EditorUtils {
//
// Serializable settings
@yasirkula
yasirkula / SnapRectTransformAnchorsToCorners.cs
Created May 28, 2024 18:20
Snap a RectTransform's anchors to its corner points in Unity
using UnityEditor;
using UnityEngine;
public class SnapRectTransformAnchorsToCorners : MonoBehaviour
{
[MenuItem("CONTEXT/RectTransform/Snap Anchors To Corners", priority = 50)]
private static void Execute(MenuCommand command)
{
RectTransform rectTransform = command.context as RectTransform;
RectTransform parent = rectTransform.parent as RectTransform;
@n-studio
n-studio / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Last active September 30, 2024 18:13
Deploy a web app on a dedicated server with Kamal

Notes

This guide uses Kamal 1.8.1

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.

@rain-1
rain-1 / LLM.md
Last active November 2, 2024 12:14
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@vpfrimmer
vpfrimmer / CustomGradleProcessor.cs
Last active January 12, 2024 01:30
IPostGenerateGradleAndroidProject to replace the instal location to "auto" in the generated AndroidManifest - Unity 2022.x
using System.IO;
using UnityEditor;
using UnityEditor.Android;
using UnityEngine;
/// <summary>
/// Used as a workaround for Unity 2022.x who isn't able to set the installlocation value to "auto" in the AndroidManifest.xml file.
/// Should be put in the Assets/Editor folder, otherwise you'll get errors on build.
/// The issue can be followed here : https://issuetracker.unity3d.com/issues/android-install-location-changes-when-exporting-project
/// </summary>
@khskekec
khskekec / libre-link-up-http-dump.md
Last active November 15, 2024 00:58
HTTP dump of Libre Link Up used in combination with FreeStyle Libre 3
@bompus
bompus / vite.config.js
Last active August 2, 2024 03:24
silence dart-sass / npm sass DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
// silence dart-sass / npm sass DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
const silenceSomeSassDeprecationWarnings = {
verbose: true,
logger: {
warn(message, options) {
const { stderr } = process;
const span = options.span ?? undefined;
const stack = (options.stack === 'null' ? undefined : options.stack) ?? undefined;
@StagPoint
StagPoint / CameraMath.cs
Created December 2, 2020 23:20
Small collection of utility functions for calculating screen size of objects, size of camera frustum at a distance, etc.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using Unity.Burst;
using Unity.Mathematics;
public static class CameraMath
{
/// <summary>