Skip to content

Instantly share code, notes, and snippets.

@Jordach
Jordach / main.py
Last active September 1, 2022 01:55
from datetime import datetime, date, timezone
import numpy as np
import pandas as pd
import sqlite3
def get_stock_from_db(ticker, interval, limit=-1):
# Translate between local SQL db and expected formatting:
pwd = os.getcwd()
name = ticker.lower()
con = sqlite3.connect(pwd + "/db/db_" + name + ".db")
@Jordach
Jordach / LuaTerminal.lua
Last active April 27, 2022 07:48
LuaTerminal
terminal_version = "0.1.4"
system_drive = "nil" --possibly irrelevant for UNIX systems. todo: these need to be loaded at startup
working_dir = "nil"
folder_dir = "nil"
os_name = "nil"
user_is_windows = "unsure" --until proven guilty....fact: Lua Terminal was made on windows.
@Jordach
Jordach / init.lua
Created September 29, 2012 17:53
init
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed)
local num_chunks = math.floor(chunks_per_volume * volume)
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
@Jordach
Jordach / .lua
Last active March 9, 2022 00:51
less strange slabs and stairs.
-- stairs, Jordach / Solar Plains redo
-- mods depend on us (to provide them with their own stairs, damn socialists!), so lets make a namespace
stairs = {}
function stairs.register_stair(subname, groups_table, images, desc, sound_table)
groups_table.stair = 1
player:set_sky({
base_color = minetest.rgba(
result_fog.r,
result_fog.g,
result_fog.b),
type = "skybox",
textures = {
sky_tex_top,
sky_tex_bottom,
sky_tex_side,
@Jordach
Jordach / example.lua
Last active December 6, 2018 14:19
Skybox PR V2
player:set_skybox({
type = "texture", -- "dynamic", "plain", "texture", "texture_dome"
textures = {"top.png", "bottom.png", "side.png", "side.png", "side.png", "side.png"},
base_color = "#rrggbb",
dynamic_color = { --applies to type = "dyanmic"
day_sky = "#rrggbb",
day_horizon = "#rrggbb",
dawn_sky = "#rrggbb",
dawn_horizon = "#rrggbb",
night_sky = "#rrggbb",
Demo Beats, Experimental Minetracker
Jordach
135
return {{["sample"] = "kick", ["vol"] = 0.25, ["fade"] = 0.0, ["pitch"] = 1.0}}
return {["gap"] = 0}
return {{["sample"] = "hat", ["vol"] = 75.0, ["fade"] = 0.0, ["pitch"] = 1.0}}
return {{["sample"] = "snare", ["vol"] = 10.0, ["fade"] = 0.0, ["pitch"] = 1.0}}
return {{["sample"] = "kick", ["vol"] = 0.25, ["fade"] = 0.0, ["pitch"] = 1.0}}
return {["gap"] = 0}
return {{["sample"] = "hat2", ["vol"] = 75.0, ["fade"] = 0.0, ["pitch"] = 1.0}}
[ 95%] Building CXX object src/CMakeFiles/minetest.dir/sound_openal.cpp.o
[ 96%] Building CXX object src/CMakeFiles/minetest.dir/staticobject.cpp.o
[ 96%] Building CXX object src/CMakeFiles/minetest.dir/subgame.cpp.o
[ 97%] Building CXX object src/CMakeFiles/minetest.dir/terminal_chat_console.cpp.o
[ 97%] Building CXX object src/CMakeFiles/minetest.dir/tileanimation.cpp.o
[ 97%] Building CXX object src/CMakeFiles/minetest.dir/tool.cpp.o
[ 98%] Building CXX object src/CMakeFiles/minetest.dir/translation.cpp.o
[ 98%] Building CXX object src/CMakeFiles/minetest.dir/version.cpp.o
[ 99%] Building CXX object src/CMakeFiles/minetest.dir/voxel.cpp.o
[ 99%] Building CXX object src/CMakeFiles/minetest.dir/voxelalgorithms.cpp.o
CMakeFiles/minetest.dir/convert_json.cpp.o: In function `fetchJsonValue(std::string const&, std::vector<std::string, std::allocator<std::string> >*)':
convert_json.cpp:(.text+0x899): undefined reference to `Json::Value::Value(Json::Value&&)'
CMakeFiles/minetest.dir/serverlist.cpp.o: In function `ServerList::deleteEntry(Json::Value const&)':
serverlist.cpp:(.text+0x2397): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x23dd): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x2409): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x2435): undefined reference to `Json::Value::Value(Json::Value&&)'
CMakeFiles/minetest.dir/serverlist.cpp.o:serverlist.cpp:(.text+0x246d): more undefined references to `Json::Value::Value(Json::Value&&)' follow
CMakeFiles/minetest.dir/serverlist.cpp.o: In function `ServerList::sendAnnounce(ServerList::AnnounceAction, unsigned short, std::vector<std::string, std::allocator<std::string>
Linking CXX executable ../bin/minetest
CMakeFiles/minetest.dir/convert_json.cpp.o: In function `fetchJsonValue(std::string const&, std::vector<std::string, std::allocator<std::string> >*)':
convert_json.cpp:(.text+0x68e): undefined reference to `Json::Value::Value(Json::Value&&)'
CMakeFiles/minetest.dir/serverlist.cpp.o: In function `ServerList::deleteEntry(Json::Value const&)':
serverlist.cpp:(.text+0x2437): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x247d): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x24a9): undefined reference to `Json::Value::Value(Json::Value&&)'
serverlist.cpp:(.text+0x24d5): undefined reference to `Json::Value::Value(Json::Value&&)'
CMakeFiles/minetest.dir/serverlist.cpp.o:serverlist.cpp:(.text+0x250d): more undefined references to `Json::Value::Value(Json::Value&&)' follow
collect2: error: ld returned 1 exit status