Skip to content

Instantly share code, notes, and snippets.

@nsauk
nsauk / glovo-address-remover.js
Created November 20, 2020 13:25
Remove saved delivery address from Glovo (bookmarklet, client-side)
javascript:
addresses = JSON.parse(localStorage.glv_user_addresses);
for (var i in addresses) {
address = addresses[i];
if (confirm(address.fullText + "\n\n" + $nuxt.$i18n.t('common.remove') + "?")) {
delete addresses['DELIVERY.' + address.placeId]
};
};
localStorage.glv_user_addresses = JSON.stringify(addresses);
location.reload();
@JoeGlines
JoeGlines / Microsoft_Zoom_In_Out_4000_Keyboard.ahk
Created October 19, 2020 12:38
Configure the Zoom key to do a page up / page down
;~ https://autohotkey.com/board/topic/36304-hidextended-input-devices-ms-natural-keyboard-4000-etc/page-2
; Capture input from the "Zoom" slider on the Natural Keyboard 4000 and use it to scroll up and scroll down
; The HID top level collection for the Natural Keyboard 4000 is:; Usage 1 ; Usage Page 12
;~ #NoTrayIcon
#SingleInstance force ; Replace any previous instance
DetectHiddenWindows, on
OnMessage(0x00FF, "InputMessage")
SizeofRawInputDeviceList := 8, SizeofRidDeviceInfo := 32, RIM_TYPEMOUSE := 0, RIM_TYPEKEYBOARD := 1, RIM_TYPEHID := 2, RIDI_DEVICENAME := 0x20000007
RIDI_DEVICEINFO := 0x2000000b, RIDEV_INPUTSINK := 0x00000100, RID_INPUT := 0x10000003, Usage := 1, UsagePage := 12
@yasirkula
yasirkula / ShaderStripper.cs
Last active March 4, 2024 09:40
Stripping commonly unused shader variants in Unity's built-in render pipeline
//#define SHADER_COMPILATION_LOGGING
//#define SKIP_SHADER_COMPILATION
using System.Collections.Generic;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
public class ShaderStripper : IPreprocessShaders
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@danielgindi
danielgindi / delete_bitbucket_lfs_files.js
Last active February 24, 2024 01:44
Bulk delete Bitbucket LFS files
(() => {
// Run this in Chrome's console, while in Bitbucket's website and logged in
const csrftoken = document.cookie.match(/\bcsrftoken=(.*?)(?:;| |$)/)[1];
const repoName = window.__initial_state__.section.repository.currentRepository.full_name;
const expiry = 1000 * 60 * 60; // Delete only files older than an hour
let page = 1;
function iterateNext() {
fetch(`https://bitbucket.org/${repoName}/admin/lfs/file-management/?iframe=true&spa=0&page=${page}`, {
@cjddmut
cjddmut / ValueTypeLists.cs
Last active May 23, 2020 19:50
C# struct based lists that can be created, passed around, and released without references or garbage.
/*
* Created by Galvanic Games (http://galvanicgames.com)
*
* 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
@randalfien
randalfien / MarkUnused.cs
Last active October 24, 2022 09:51
Unity Mark Unused Assets
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public class MarkUnused
{
private const string UnusedLabel = "Unused"; // All unused assets will be tagged with this label
@fnky
fnky / ANSI.md
Last active May 22, 2024 08:06
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@grifdail
grifdail / VectorSwizzle.cs
Created August 21, 2018 19:31
Vector swizzle in unity
using UnityEngine;
static class Vector2Swizzles {
// swizzle of size 2
public static Vector2 Swizzle_xx(this Vector2 a) { return new Vector2(a.x, a.x); }
public static Vector2 Swizzle_xy(this Vector2 a) { return new Vector2(a.x, a.y); }
public static Vector2 Swizzle_x0(this Vector2 a) { return new Vector2(a.x, 0); }
public static Vector2 Swizzle_x1(this Vector2 a) { return new Vector2(a.x, 1); }
public static Vector2 Swizzle_yx(this Vector2 a) { return new Vector2(a.y, a.x); }
@zoon
zoon / update-unity-compiler.cmd
Last active February 25, 2019 11:04
Latest version of Roslyn for unity.incrementalcompiler
@rem update-unity-compiler.cmd
@rem start in */com.unity.incrementalcompiler@X.Y.ZZ folder
@echo off
@rem NOTE: FIND.EXE can clash with git/msys/cygwin's find
for %%a in (%ComSpec%) do set __system=%%~dpa
%__system%FIND.EXE /i "com.unity.incrementalcompiler" package.json 1> NUL
if %errorlevel% neq 0 goto :not_found
nuget install Microsoft.Net.Compilers -verbosity quiet