This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mechanize' | |
require 'nokogiri' | |
require 'json' | |
require 'pp' | |
class String | |
def between marker | |
self[/#{Regexp.escape(marker)}(.*?)#{Regexp.escape(marker)}/m, 1] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) | |
)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Event = Elona.require("Event") | |
local Enums = Elona.require("Enums") | |
local Item = Elona.require("Item") | |
local Chara = Elona.require("Chara") | |
local GUI = Elona.require("GUI") | |
local table = Elona.require("table") | |
local potions = {736, 711, 706, 626, 577, 566, 559, 519, 433, 432, | |
429, 382, 379, 376, 375, 372, 370, 368, 364, 287, 286, 285, 262, 76, | |
75, 74, 72, 71, 70, 69, 68, 30, 29, 28, 27} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires mpv. | |
require "optparse" | |
require "find" | |
require "pathname" | |
require "ostruct" | |
require "fileutils" | |
require "io/console" | |
def is_num?(str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] extern crate hlua; | |
mod point; | |
use std::fmt::{self, Display}; | |
use hlua::Lua; | |
use point::Point; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 4.9.6 Kernel Configuration | |
# | |
CONFIG_64BIT=y | |
CONFIG_X86_64=y | |
CONFIG_X86=y | |
CONFIG_INSTRUCTION_DECODER=y | |
CONFIG_OUTPUT_FORMAT="elf64-x86-64" | |
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lookup_jisho() | |
local text = mp.get_property("sub-text") | |
if text == "" then | |
return | |
end | |
mp.set_property("pause", "yes") | |
os.execute("open \"http://jisho.org/search/" .. text .. "\"") | |
end | |
mp.add_key_binding("Ctrl+j", "lookup_jisho", lookup_jisho) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create animated GIFs with mpv | |
-- Requires ffmpeg. | |
-- Adapted from http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
-- Usage: "g" to set start frame, "G" to set end frame, "Ctrl+g" to create. | |
local msg = require 'mp.msg' | |
-- Set this to the filters to pass into ffmpeg's -vf option. | |
-- filters="fps=24,scale=320:-1:flags=lanczos" | |
filters="fps=15,scale=540:-1:flags=lanczos" |