Skip to content

Instantly share code, notes, and snippets.

View TaizWeb's full-sized avatar
📝
Writing Code by Hand

Taiz TaizWeb

📝
Writing Code by Hand
  • Pikeville, TN
View GitHub Profile
@TaizWeb
TaizWeb / escape-fix.lua
Last active April 27, 2020 02:34
A function to fix escape sequences in lua strings. Useful for preparing JSON from an API for conversion.
function escapeFix(data)
local newData = ""
for i=1,string.len(data) do
local char = string.sub(data, i, i)
local nextChar = string.sub(data, i+1, i+1)
local prevChar = string.sub(data, i-1, i-1)
if (char == '"' and (prevChar ~= "{" and nextChar ~= ":" and prevChar ~= ":" and nextChar ~= "," and prevChar ~= "," and nextChar ~= "}")) then
newData = newData .. "\\" -- Append another, non-escaped, '\'
end
newData = newData .. string.sub(data, i, i)
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
console.log("Two plus two is " + 2 + 2 + "!");
// Prints "Two plus two is 22!"
@TaizWeb
TaizWeb / dialog_example.txt
Created March 6, 2020 23:39
A short dialog sample for testgame_v2
[MM]
This is where I get off kid.
I'm supposed to speak a bit?
Each line is a box of dialog.
[MC]
And the box up top?
[MM]
@TaizWeb
TaizWeb / numix-mastofe.css
Last active July 31, 2018 01:52
Updated to add more numix theme
.drawer__header { /* The collection of buttons on top */
background: #444444;
}
.drawer__tab { /* The above's icons */
color: #a7a7a7;
}
.drawer__header a:hover { /* The above's hover action */
background: #f0544c;
// Originally made for https://nookipedia.com/wiki/Bugs/Animal_Crossing:_Wild_World
returnedObj = '[\n';
function scrapeBugs() {
for (let i = 0; i < 56; i++) {
bugName = document.getElementById('mw-content-text').children[1].children[1].children[i].children[1].children[0].innerHTML;
returnedObj += `\t{'task_name': '${bugName}', 'task_complete': false},\n`;
}
returnedObj += '\n]';
return returnedObj;
}
// Originally used on https://nookipedia.com/wiki/Fish/Animal_Crossing:_Wild_World to extract fish data
returnedObj = '[\n';
function scrapeFish() {
for (var i = 0; i < 56; i++) {
fishName = document.body.children[7].children[0].children[0].children[1].children[0].children[1].children[1].children[4].children[3].children[0].children[2].children[0].children[1].children[i].children[1].children[0].innerHTML;
returnedObj += `\t{'task_name': '${fishName}', 'task_complete': false},\n`;
}
returnedObj += '\n]';
return returnedObj;
}