Skip to content

Instantly share code, notes, and snippets.

local Chara = Elona.require("Chara")
local Event = Elona.require("Event")
local Iter = Elona.require("Iter")
local Map = Elona.require("Map")
local function setup()
local player_pos = Chara.player().position
for pos in Iter.rectangle_iter(player_pos.x - 1, player_pos.y - 1,
player_pos.x + 1, player_pos.y + 1) do
if not (pos.x == player_pos.x and pos.y == player_pos.y) then
# usage: ruby compare.rb first.json second.json
# gnuplot is required.
# produce output.json by running:
# make clean
# make bench
# bin/ElonaFoobar --output json > output.json
require "json"
class Comparison
@Ruin0x11
Ruin0x11 / csharp-mode-hacks.el
Last active February 25, 2019 20:46
Hack for csharp-mode for string interpolation
;; A hack for csharp-mode to highlight string interpolation expressions like $"{foo} {bar}". Adapted from ruby-mode.
(c-lang-defconst c-basic-matchers-after
csharp `(
;; ...
,`(csharp-match-expression-expansion
0 font-lock-variable-name-face t)
))
@Ruin0x11
Ruin0x11 / scrape.rb
Created September 20, 2019 02:16
Scrape Reaktor User Library
require 'mechanize'
require 'nokogiri'
require 'json'
require 'pp'
class String
def between marker
self[/#{Regexp.escape(marker)}(.*?)#{Regexp.escape(marker)}/m, 1]
end
end
@Ruin0x11
Ruin0x11 / vstest.el
Last active October 3, 2019 20:50
Use VSTest from Emacs
(defcustom vstest-assembly "" "VSTest assembly to use")
(setq vstest-assembly "C:\\path\\to\\assembly.dll")
(defun vstest-console-all ()
(interactive)
(let ((class-name (file-name-sans-extension (buffer-name)))
(default-directory (projectile-project-root))
(assembly vstest-assembly))
(compile (concat "vstest.console " assembly))))
@Ruin0x11
Ruin0x11 / rar2zip.sh
Created January 23, 2020 21:33
rar2zip.sh
#!/bin/bash
#
# rar2zip conversion script
# Based on: https://shkspr.mobi/blog/2016/12/converting-rar-to-zip-in-linux/
#
# Usage: rar2zip.sh file [file ...]
echo "Converting RARs to ZIPs"
# Use RAM disk for temporary files.
@Ruin0x11
Ruin0x11 / auth.lua
Created January 27, 2020 11:53
YouTube account challenge auth
-- luarocks install inspect
local inspect = require("inspect")
local requests = require("requests")
local json = require("json")
local function p(...)
print(inspect(...))
end
URxvt*foreground: #DDCCBB
! Brown BG
!*background: #30251D
! Grey BG
URxvt*background: #151515
!black
@Ruin0x11
Ruin0x11 / nginx.dev.conf
Last active May 3, 2020 20:22
szurubooru dev config
pid /tmp/nginx/nginx.pid;
error_log /tmp/nginx/error.log;
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
http {
@Ruin0x11
Ruin0x11 / SpellsMenu.lua
Created July 10, 2020 05:50
IUiLayer template
local Gui = require("api.Gui")
local Draw = require("api.Draw")
local I18N = require("api.I18N")
local Ui = require("api.Ui")
local data = require("internal.data")
local IUiLayer = require("api.gui.IUiLayer")
local UiList = require("api.gui.UiList")
local UiWindow = require("api.gui.UiWindow")
local InputHandler = require("api.gui.InputHandler")