Skip to content

Instantly share code, notes, and snippets.

View viluon's full-sized avatar
👁️
stop the race towards misaligned AI

Andrew Kvapil viluon

👁️
stop the race towards misaligned AI
View GitHub Profile
@viluon
viluon / LibDeflate.lua
Last active July 21, 2023 13:55
gzip compression-only CC-flavoured of LibDeflate
--[[--
LibDeflate 1.0.0-release <br>
Pure Lua compressor and decompressor with high compression ratio using
DEFLATE/zlib format.
@file LibDeflate.lua
@author Haoqian He (Github: SafeteeWoW; World of Warcraft: Safetyy-Illidan(US))
@copyright LibDeflate <2018> Haoqian He
@license GNU General Public License Version 3 or later
@viluon
viluon / cors-proxy.js
Created July 18, 2022 22:01
Deploy this with CloudFlare Workers to get a CORS proxy for your Copy Cat deployment.
// Cloudflare supports the GET, POST, HEAD, and OPTIONS methods from any origin,
// and allow any header on requests. These headers must be present
// on all responses to all CORS preflight requests. In practice, this means
// all responses to OPTIONS requests.
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET,HEAD,POST,OPTIONS',
'Access-Control-Max-Age': '86400',
};
@viluon
viluon / Dockerfile
Created October 15, 2020 14:40
Dockerfile for building GHC
FROM archlinux:20200205 AS arch-ghc-build-env
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm git base-devel go python python-sphinx libedit numactl exa
# use all possible cores for subsequent package builds
RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
# don't compress the packages built here
RUN sed -i "s,PKGEXT='.pkg.tar.xz',PKGEXT='.pkg.tar',g" /etc/makepkg.conf
# set up the packager user

Keybase proof

I hereby claim:

  • I am viluon on github.
  • I am viluon (https://keybase.io/viluon) on keybase.
  • I have a public key ASC2cjxCPwVY677g4EHdpqUpshoT8smPCDaI59Lrx_SK9wo

To claim this, I am signing this object:

local upvalue = {}
local x = {}
local ns = {}
local index = 1
function ns.inner()
return upvalue()
end
import io.ebean.EbeanServer;
import io.ebean.annotation.SoftDelete;
import me.factorify.server.common.MapperTools;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.*;
-- LICENSE
--
-- This software is dual-licensed to the public domain and under the following
-- license: you are granted a perpetual, irrevocable license to copy, modify,
-- publish, and distribute this file as you see fit.
-- VERSION 0.1.0
-- Author: Forrest Smith (github.com/forrestthewoods/lib_fts)
-- Translated to Lua by Blake Mealey (github.com/blake-mealey)
@viluon
viluon / socketlanes.lua
Created June 14, 2017 06:55 — forked from Deco/socketlanes.lua
Multi-threaded LuaSocket with Lua Lanes example
--[[ socketlanes.lua
Multi-threaded LuaSocket with Lua Lanes example
===============================================
Depends on the following LuaSocket 2.0.2 patch:
http://www.net-core.org/dl/luasocket-2.0.2-acceptfd.patch
(via http://www.net-core.org/39/lua/patching-luasocket-to-make-it-compatible)
(provided at end of file)
--- Port of https://github.com/forrestthewoods/lib_fts/blob/master/code/fts_fuzzy_match.js
-- to Lua
--- Check if ptrn is found sequentially within str
local function matchSimple(str, ptrn)
local ptrnCtr, strCtr = 1, 1
local ptrnLen, strLen = #ptrn, #str
while ptrnCtr <= ptrnLen and strCtr <= strLen do
local ptrnChar = ptrn:sub(ptrnCtr, ptrnCtr):lower()
@viluon
viluon / sample.vsl
Created November 19, 2016 11:51
FIKS VM
// viluon's simple language
// Test modulo
mod 10 11