Skip to content

Instantly share code, notes, and snippets.

@haolly
haolly / loop.js
Created May 24, 2018 07:54 — forked from dmh2000/loop.js
javascript loop with async callback handling
"use strict";
// =================================================
// a common question that pops up is
// 'why do my async functions use the final value of my loop variable instead of the one they are called with'?
// its because they refer directly to the loop variable and its last value
// the solutions are various ways to bind the loop variable in a new scope
//
// this gist shows different ways to handle a loop that spawns an async function that depends on the loop index
// =================================================
@haolly
haolly / src.Makefile.patch
Created January 27, 2019 07:08 — forked from dcarrith/src.Makefile.patch
fPIC Patch file for src/Makefile for lua-5.3.0
--- src/Makefile.original2015-02-27 10:53:53.130125907 -0500
+++ src/Makefile 2015-02-27 10:53:24.674126798 -0500
@@ -7,7 +7,7 @@
PLAT= none
CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@haolly
haolly / Makefile.patch
Created January 27, 2019 13:50 — forked from dcarrith/Makefile.patch
fPIC Patch file for the main Makefile for lua-5.3.0
--- Makefile 2014-10-29 19:14:41.000000000 -0400
+++ Makefile.patched 2015-02-27 14:19:23.077739861 -0500
@@ -38,21 +38,21 @@
# Convenience platforms targets.
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+# Lua version and release.
+V= 5.3
+R= $V.0
+
@haolly
haolly / NativeMeshTest.cs
Created May 18, 2019 15:35 — forked from LotteMakesStuff/NativeMeshTest.cs
[NativeCollections] How to copy a regular .C# array into a NativeArray suuuuuper quick using memcpy. its about as fast as its ever gunna get!
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using UnityEngine;
public class NativeMeshTest : MonoBehaviour
{
private NativeArray<float3> vertexBuffer;
private Vector3[] vertexArray;
@haolly
haolly / breachcompilation.txt
Created August 25, 2019 18:55
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@haolly
haolly / youtube-dl.conf
Created September 8, 2019 17:42
youtube-dl config for me on widows10 that works
# Lines starting with # are comments
# Always extract audio
-x
# Do not copy the mtime
--no-mtime
# Use this proxy
--proxy 127.0.0.1:1080
@haolly
haolly / msys.reg
Created September 20, 2019 13:34 — forked from kfxhjz/msys.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\msys2_shell]
@="Open MSYS2 here"
"Icon"="\"D:\\msys64\\msys2.ico\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\msys2_shell\command]
@="D:\\msys64\\msys2_shell.cmd -mingw -here"
[HKEY_CLASSES_ROOT\Folder\shell\msys2_shell]
@haolly
haolly / FocusOnPivot.cs
Created October 7, 2019 04:05
Unity UI easy pivot view
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class FocusOnPivot : MonoBehaviour {
[MenuItem("Edit/Focus on Selected Pivot %g")]
static void Focus()
{
@haolly
haolly / UnityGuidRegenerator.cs
Created March 27, 2020 09:13 — forked from ZimM-LostPolygon/UnityGuidRegenerator.cs
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
@haolly
haolly / PyramidGenerator.cs
Created June 16, 2020 07:34 — forked from grifdail/PyramidGenerator.cs
Editor tool to generate Pyramid and Cone in unity. Save this script in an Editor Folder and it will create a new menu option in Assets/Create; You can chose the number of side and between hard and soft edge.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class PyramidGenerator : ScriptableWizard
{
public int size = 4;
public bool flat = true;