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
-- Copyright (C) SmallJoker 2022 - 2025 | |
-- License: MIT | |
-- This script imports the lua_api.md file from Luanti/Minetest to CudaText for | |
-- auto-completion. Tested with LuaJIT and a Luanti 5.12.0-dev file. | |
-- Usage: | |
-- 1. $ luajit THIS_SCRIPT.lua /path/to/lua_api.md | |
-- 2. Append the generated file to $HOME/.config/cudatext/data/autocomplete/Lua.acp | |
-- 3. Restart CudaText |
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
#!/usr/bin/env bash | |
# "xdg-grep" script for $HOME/.local/bin/ | |
set -e | |
if [ -z "$1" ]; then | |
echo "Missing keyword" | |
exit 0 | |
fi |
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
#include <set> | |
#include <stdexcept> // std::runtime_error | |
#include <stdio.h> | |
#define DO_ERROR() do { throw std::runtime_error("fault"); } while(0) | |
class PtrAutoNullOMatic { | |
public: | |
PtrAutoNullOMatic() = default; | |
~PtrAutoNullOMatic() |
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
// Auto-unlock wrapper for larger operations | |
/* | |
Exmaple usage: | |
struct MyStruct { | |
PtrLock<decltype(m_value)> getValues() | |
{ | |
return PtrLock<decltype(m_value)>(m_lock, &m_value); | |
} |
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
#include <iostream> | |
#include <stdint.h> | |
#include <vector> | |
#include "vector3d.h" | |
using u8 = unsigned char; | |
using s16 = int16_t; | |
using u16 = uint16_t; | |
using v3s16 = irr::core::vector3d<s16>; |
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 ft = {} | |
ft.__index = ft | |
function FSTile(w, h) | |
local self = {} | |
setmetatable(self, ft) | |
-- init stuff here | |
self.containers = {} | |
self.width = w | |
self.height = h |
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
cd irrlicht | |
# Fake installation dir | |
mkdir -p __output/include | |
mkdir -p __output/lib/cmake/IrrlichtMt | |
ln -sf ../../include __output/include/irrlichtmt | |
cp -f IrrlichtMt*.cmake __output/lib/cmake/IrrlichtMt/ | |
cp -fP lib/Linux/libIrrlichtMt* __output/lib/ | |
cp -fr CMakeFiles/Export/lib/cmake __output/lib/ |
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
Filter Rules | |
============== | |
Works for: | |
- AdblockPlus | |
- ublock origin | |
- ?? | |
Group by: Repository |
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
minetest.register_privilege( "lava", "Can place lava at any depth.") | |
local LAVA_PLACE_DEPTH = -50 | |
function override_on_place(item_name) | |
local def = minetest.registered_items[item_name] | |
local old_on_place = def.on_place | |
def.on_place = function(itemstack, placer, pointed_thing) | |
if pointed_thing.type ~= "node" 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
#!/bin/bash | |
remote="upstream" | |
url=$(LANG=C git remote -v get-url $remote 2>&1) | |
if [[ $url == fatal* || $url == error* ]]; then | |
remote="origin" | |
url=$(LANG=C git remote -v get-url $remote 2>&1) | |
fi | |
if [[ $url == fatal* || $url == error* ]]; then |
NewerOlder