Skip to content

Instantly share code, notes, and snippets.

kahrl

Block or report user

Report or block kahrl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simplifier.py
import readline
class SimplifierError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
TOL = 1e-10
View gist:b288cd6063da36aae2dc
diff --git a/src/client.cpp b/src/client.cpp
index 601561f..459d371 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2196,8 +2196,8 @@ void Client::sendReady()
writeU8(os,VERSION_PATCH_ORIG);
writeU8(os,0);
- writeU16(os,strlen(CMAKE_VERSION_GITHASH));
- os.write(CMAKE_VERSION_GITHASH,strlen(CMAKE_VERSION_GITHASH));
View gist:c2c7df94c17efec74f5c
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index 3e2e778..2970e7b 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -254,6 +254,7 @@ minetest.register_entity("experimental:dummyball", {
minetest.register_on_chat_message(function(name, message)
local cmd = "/dummyball"
if message:sub(0, #cmd) == cmd then
+ count = tonumber(message:sub(#cmd+1)) or 1
if not minetest.get_player_privs(name)["give"] then
View gist:c81254227e11f09fd31f
diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp
index 4c098f8..0d03468 100644
--- a/src/script/common/c_internal.cpp
+++ b/src/script/common/c_internal.cpp
@@ -64,8 +64,10 @@ int script_exception_wrapper(lua_State *L, lua_CFunction f)
return f(L); // Call wrapped function and return result.
} catch (const char *s) { // Catch and convert exceptions.
lua_pushstring(L, s);
- } catch (LuaError& e) {
+ } catch (std::exception& e) {
View gist:e46c91e1e27188fa7cf4
diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua
index 3e2e778..729191b 100644
--- a/games/minimal/mods/experimental/init.lua
+++ b/games/minimal/mods/experimental/init.lua
@@ -254,6 +254,7 @@ minetest.register_entity("experimental:dummyball", {
minetest.register_on_chat_message(function(name, message)
local cmd = "/dummyball"
if message:sub(0, #cmd) == cmd then
+ count = tonumber(message:sub(#cmd+1)) or 1
if not minetest.get_player_privs(name)["give"] then
View gist:cfe7e46cc2ffcdee3cfb
#include <iostream>
class Barney {
int age;
public:
Barney() { age = 42; }
Barney& operator++() {
age++;
std::cout << "Barney is " << age << " years old." << std::endl;
return *this;
View gist:4ee8911c341f7158343c
diff --git a/src/client.cpp b/src/client.cpp
index 8a64b9c..d083374 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -2477,9 +2477,11 @@ int Client::getCrackLevel()
void Client::setHighlighted(v3s16 pos, bool node_highlighted)
{
- m_node_highlighted = node_highlighted;
- addUpdateMeshTaskForNode(m_highlighted_pos, false, true);
View gist:9135ee4a92693dc2c051
#
# Relevant history:
#
# commit 1995b59320fe0fdced55c4605635f38cc42768f1 (2011-04-23)
# Moved lots of code from main.cpp:main() to game.cpp:the_game()
#
# commit 4e249fb3fbf75f0359758760d88e22aa5b14533c (2010-09-27)
# First git commit. Minetest existed before then but not in git.
#
View gist:b4a0337320beeaa48227
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 4b1beb2..4766524 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -938,7 +938,7 @@ void Inventory::deSerialize(std::istream &is)
}
else
{
- throw SerializationError("invalid inventory specifier");
+ throw SerializationError("invalid inventory specifier: " + name);
View gist:35ab89659c223d74b000
root@drac1:/var/www/weblate# ./manage.py syncdb
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
You can’t perform that action at this time.