Skip to content

Instantly share code, notes, and snippets.

@Shoozza
Shoozza / install_luarocks_windows_10.md
Last active March 10, 2024 09:34
Installing Luarocks on Windows with MSYS2 and gcc

Installing Luarocks on Windows

Getting Luarocks to work on Windows 8.1/10 with MSYS2 gcc (mingw64)

1. MSYS2 installation

  1. Visit https://www.msys2.org/
  2. Click on the link next to "Download the installer"
  3. Run the installer
  4. Add "C:\msys64\usr\bin" to path
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@Yanrishatum
Yanrishatum / heapsfaq.md
Last active May 1, 2024 18:04
An Unofficial Heaps FAQ

An Unofficial Heaps FAQ

I (Yanrishatum) see too many same questions. They irritate me.

Translation

"How dare you come into this chat and not realize that i am the GOD of heaps and that you MUST check out MY documentation1!!! Im veyr abngrey!!!" - translation from someone in chat.

Very accurate, I highly approve.

@Yanrishatum
Yanrishatum / hlc.md
Last active April 8, 2023 15:50
How to compile HL/C

How to compile HL/C

Prepwork/terms

Because I have no trust in people.

  • <hashlink> points to your installation of Hashlink, e.g. folder in which hl.exe (or Unix executable) is, alongside with library binaries (.hdll files), and include folder.
  • <src> points to the folder containing generated HL/C sources. One that contains hlc.json file.
  • <app> refers to your output executable name, including extension.
  • <main> refers to your entry-point file name, including extension (see below).
  • I provide example of doing it on Windows via MSVC cl.exe, but Unix should be more or less same with replacement of argument flags and compiler.
  • I expect that you DO have a compiler installed and can call cl.exe or other compiler from command-line.
@1bardesign
1bardesign / oo.lua
Last active February 6, 2019 04:41
state management code - fsm and a push/pop "game state manager" - see state_machine.lua for the main interesting bit
--[[
oop basics
]]
function class(inherits)
local c = {}
c.__mt = {__index = c}
--handle single inheritence
if type(inherits) == "table" and inherits.__mt then
setmetatable(c, inherits.__mt)
@freedmand
freedmand / tester.js
Last active November 7, 2018 11:13
JavaScript unit testing in under 30 lines
const PASS = ['32']; // green
const FAIL = ['31', '1']; // red, bold
function logStyle(ansiEscapeCodes, text) {
console.log(`\x1b[${ansiEscapeCodes.join(';')}m${text}\x1b[0m`);
}
class Tester {
constructor() {}
--[[
"semi-manual" garbage collection
specify a time budget and a memory ceiling per call.
called once per frame, this will spread any big collections
over a couple of frames, and "catch up" when there is. This
keeps GC burden much more predictable.
The memory ceiling provides some level of "relief valve" - if
@Shoozza
Shoozza / userContent.css
Last active April 28, 2019 12:59
Firefox Readermode dark sidebar theme + hidden + show on hover + yellow selection + yellow link color
/*
how to install:
- visit about:support
- open profile folder
- create/edit chrome\userContent.css file
*/
@-moz-document url-prefix("about:reader") {
/* fix toolbar */
.toolbar {
@josefnpat
josefnpat / Makefile
Last active July 5, 2020 08:19
Love Makefile of Doom
# Copyright 2017 Josef N Patoprsty
#
# 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:
#
# The above copyright notice and this permission notice shall be included in all