Skip to content

Instantly share code, notes, and snippets.

sapier

Block or report user

Report or block sapier

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
@sapier
sapier / test_unsafe_functions.lua
Created Jan 22, 2017
Testcode for unsafe functions
View test_unsafe_functions.lua
local os_functiontable = {
-- fct, allowed, p1, p2, p3
{ "clock", true, nil, nil, nil },
{ "date", true, nil, nil, nil },
{ "difftime", true, 10000, 9000, nil },
{ "execute", false, "/bin/true", nil, nil },
{ "getenv", false, "SHELL", nil, nil },
{ "rename", false, "/tmp/somefile", "/tmp/someotherfile", nil },
{ "remove", false, "/tmp/someotherfile", nil, nil },
View gist:f8ebd68f18d29f80dd4743e8b917f705
2017-01-21 18:32:07: ACTION[Main]: Testing for os.clock...
2017-01-21 18:32:07: ACTION[Main]: function present
2017-01-21 18:32:07: ERROR[Main]: function works
2017-01-21 18:32:07: ERROR[Main]: function returned: 1.211562
2017-01-21 18:32:07: ACTION[Main]: Testing for os.date...
2017-01-21 18:32:07: ACTION[Main]: function present
2017-01-21 18:32:07: ERROR[Main]: function works
2017-01-21 18:32:07: ERROR[Main]: function returned: "Sa 21 Jan 2017 18:32:07 CET"
2017-01-21 18:32:07: ACTION[Main]: Testing for os.difftime...
2017-01-21 18:32:07: ACTION[Main]: function present
View gist:bbca8328723006b97d0c16ea42cac578
/home/sapier/minetest.folder/minetest.update/src/content_sao.cpp: In member function ‘virtual void UnitSAO::detachFromParent()’:
/home/sapier/minetest.folder/minetest.update/src/content_sao.cpp:211:52: warning: passing NULL to non-pointer argument 1 of ‘virtual void UnitSAO::setAttachment(int, const string&, v3f, v3f)’ [-Wconversion-null]
setAttachment(NULL, "", v3f(0, 0, 0), v3f(0, 0, 0));
View gist:a8ce7b49ef3529545fe96624b31cbd6f
MYMIN(256, dst_c.getRed() - (255 - color.getRed())),
MYMIN(256, dst_c.getGreen() - (255 - color.getGreen())),
MYMIN(256, dst_c.getBlue() - (255 - color.getBlue()))
View gist:0da9d5248a6327522d52fd702202d721
make
[ 0%] Built target genrev
[ 0%] Built target revision.h
[ 1%] Performing build step for 'TBB_Project'
In file included from ../../src/tbb/concurrent_queue.cpp:29:0:
/usr/include/c++/4.9/cstring:41:28: fatal error: bits/c++config.h: Datei oder Verzeichnis nicht gefunden
#include <bits/c++config.h>
^
compilation terminated.
In file included from /usr/include/c++/4.9/stdexcept:38:0,
View gist:6082c894cae0345dd371
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 17 took 5225 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 18 took 5991 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 19 took 8089 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 20 took 7323 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 21 took 8163 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 22 took 8951 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 23 took 10205 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 24 took 10834 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 25 took 11570 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 26 took 12544 us
View gist:563634e7e9513c408a7a
A irrlicht/examples/14.Win32Window/Win32Window.vcproj
A irrlicht/examples/14.Win32Window/Win32Window_vc8.vcproj
A irrlicht/examples/14.Win32Window/Makefile
A irrlicht/examples/14.Win32Window/Win32Window.cbp
A irrlicht/examples/14.Win32Window/Win32Window_vc10.vcxproj
A irrlicht/examples/14.Win32Window/Win32Window_vc9.vcproj
A irrlicht/examples/14.Win32Window/Win32Window_vc11.vcxproj
U irrlicht
Ausgecheckt, Revision 5122.
patching file include/IEventReceiver.h
View gist:5bef14dd1fa75bf1d086
ZEIT - ts aI t
WOHNZIMMER ' v o: n - ts I - m 6
OBEN o: - b @ n
AN @ n
AUS aU s
WEATHER - v e: - a - t 6
GANG - g a N
TOMORROW - t o: - m o: - r aU
UNTEN U n - t @ n
LICHT l I C t
View gist:d715be2ba96c50d79a7a
diff --git a/src/craftdef.cpp b/src/craftdef.cpp
index 9cd1d8c..fa1f9ea 100644
--- a/src/craftdef.cpp
+++ b/src/craftdef.cpp
@@ -954,7 +954,9 @@ class CCraftDefManager: public IWritableCraftDefManager
try {
tmpout = def->getOutput(input, gamedef);
- if(tmpout.item.substr(0,output.item.length()) == output.item)
+ if((tmpout.item.substr(0,output.item.length()) == output.item) &&
View gist:caeb84741dcc7314fb6f
local filters = {
{"No Filter", ""},
{"Bilinear Filter", "bilinear_filter"},
{"Trilinear Filter", "trilinear_filter"},
}
<snip>
function getFilterSettingIndex()
for i in ipairs(filters) do
You can’t perform that action at this time.