Skip to content

Instantly share code, notes, and snippets.

@ZakBlystone
ZakBlystone / sstv.lua
Last active June 17, 2020 09:27
GLua experiment to take a screenshot and generate an SSTV signal from it
-- SSTV experiment (CC0 Public Domain, free to use in whatever you want)
-- Created by: Zachary Blystone ( [email protected] )
local rate = 44100
local image = {}
local function co()
local dt = 1 / rate
local p = 0
@josephan
josephan / setup_tailwind_in_phoenix.md
Last active August 8, 2023 05:50
Add Tailwind CSS to an Elixir/Phoenix Project with PurgeCSS
@ddunkin
ddunkin / cloudsql-proxy.ts
Last active September 21, 2022 15:10
Pulumi functions to setup and add a Google Cloud SQL Proxy sidecar to a Kubernetes deployment
import * as pulumi from '@pulumi/pulumi';
import * as gcp from '@pulumi/gcp';
import * as k8s from '@pulumi/kubernetes';
import * as k8sInputApi from '@pulumi/kubernetes/types/input';
const serviceAccountKeys = new Map<string, gcp.serviceAccount.Key>();
/**
* Creates a service account and key, and sets the cloudsql.client role in IAM.
*/
@meepen
meepen / lujlu.lua
Last active February 9, 2024 09:18
LuaJit VM in Lua. Comes with fully operational bytecode interpreter. License is: contact me before using it commercially. - Now runs itself inside itself and itself inside itself inside itself
local bytecodes = {}
local BC, run_function = {}
local VARG_CONST = {}
local lujlu_mt_funcs
local lujlu_cache = setmetatable({}, {__mode = "k"})
local lujlu_identifier_mt = {
__tostring = function(self)
return tostring(lujlu_cache[self].data)
end,
@Starfox64
Starfox64 / htmlentities.lua
Last active March 6, 2017 11:53
Small library to process HTML entities in Garry's Mod.
--[[
Entities list by Walter Cruz.
Library by _FR_Starfox64.
]]--
htmlentities = {}
htmlentities.entities = {
[" "] = "&nbsp;",
["¡"] = "&iexcl;",
@mentlerd
mentlerd / sh_grep.lua
Created January 28, 2015 12:10
Pretty printing for gmod13
-- Global 'nil' value
NIL = {}
-- Localise for faster access
local pcall = pcall
local string_len = string.len
local string_sub = string.sub
local string_find = string.find
package org.objectweb.asm.graph;
import com.revtek.util.*;
import com.revtek.util.io.*;
import org.objectweb.asm.core.*;
import org.objectweb.asm.tree.*;
import java.util.*;
import java.util.logging.*;
function unrequire( modName )
if( not modName ) then return end
local _R = debug.getregistry()
local moduleMetatable = _R["_LOADLIB"]
package.loaded[ modName ] = nil
_G[ modName ] = nil
for k, ud in pairs( _R ) do
if( (type(k) == "string") and string.find( k, "^LOADLIB: .+gm.._" .. modName .. "_.+%.dll$" ) and (type(ud) == "_LOADLIB") and (getmetatable(ud) == moduleMetatable) ) then
print( "Unloading: " .. k )
@samuelmaddock
samuelmaddock / cl_browserpool.lua
Created April 22, 2014 16:25
Awesomium Pool Interface
if browserpool then return end -- ignore Lua refresh
local table = table
local vgui = vgui
_G.browserpool = {}
--
-- Debug variable which will allow outputting messages if enabled.
-- @type boolean
@vukicevic
vukicevic / Draw Bitmap From Int Array
Last active October 31, 2023 08:50
Generate a monochrome bitmap image in JavaScript using a byte-array. The image is generated such that every bit in the array is shown as either a black (1) or white (0) pixel.
/**
* depth: 1 - monochrome
* 4 - 4-bit grayscale
* 8 - 8-bit grayscale
* 16 - 16-bit colour
* 32 - 32-bit colour
**/
function drawArray(arr, depth) {
var offset, height, data, image;