This file contains 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
static void register_loader(lua_State * L, const char * files_dir) { | |
char custom_path[PATH_MAX+1]; | |
lua_getglobal(L, "package"); | |
lua_getfield(L, -1, "loaders"); | |
int num_loaders = lua_objlen(L, -1); | |
lua_pushcfunction(L, asset_loader); | |
lua_rawseti(L, -2, 2); | |
lua_pop(L, 1); |
This file contains 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
V/SDL ( 3377): onResume() | |
I/ActivityManager( 1396): Displayed activity org.libsdl.app/.SDLActivity: 478 ms (total 478 ms) | |
W/IInputConnectionWrapper( 1509): showStatusIcon on inactive InputConnection | |
V/SDL ( 3377): surfaceCreated() | |
V/SDL ( 3377): surfaceChanged() | |
V/SDL ( 3377): pixel format unknown -1 | |
V/SDL ( 3377): Window size:480x270 | |
I/SDL ( 3377): SDL_Android_Init() | |
I/SDL ( 3377): SDL_Android_Init() finished! | |
V/SDL ( 3377): Creating new EGL Surface |
This file contains 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
/* | |
I think I finally found a good use for precompiled headers. | |
If you want to compile in visual studio with maximum warning levels on, and your problem | |
is that the windows headers are shit, you can put them in the precompiled headers surrounded | |
by pragma warning disable magic | |
The difference between just including windows.h and EnableAllWarnings (/Wall) and doing | |
the following is 82 lines of warnings: | |
*/ |
This file contains 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 <fcgiapp.h> | |
#include <stdlib.h> | |
const char * meta[] = { | |
"AUTH_TYPE", | |
"CONTENT_LENGTH", | |
"CONTENT_TYPE", | |
"GATEWAY_INTERFACE", | |
"PATH_INFO", | |
"PATH_TRANSLATED", |
This file contains 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
function recover(turn) | |
eressea.free_game() | |
eressea.read_game(turn .. ".dat") | |
ships = {} | |
bldgs = {} | |
for r in regions() do | |
for b in r.buildings do | |
if b.info~=nil and (string.len(b.info)>120) then | |
bldgs[b.id] = b.info | |
end |
This file contains 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
diff --git a/Rakefile b/Rakefile | |
index ae0765a..77bdbbc 100644 | |
--- a/Rakefile | |
+++ b/Rakefile | |
@@ -9,7 +9,8 @@ ssh_port = "22" | |
document_root = "~/website.com/" | |
rsync_delete = false | |
rsync_args = "" # Any extra arguments to pass to rsync | |
-deploy_default = "rsync" | |
+weex_args = "-s blog" |
This file contains 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
function new_faction(email, race, lang, r) | |
f = faction.create(email, race, lang) | |
u = unit.create(f, r, 10) | |
u:add_item("log", 5); | |
u:add_item("horse", 2); | |
u:add_item("silver", 1000); | |
u:add_item("adamantium", 1); | |
end | |
function get_homes(f) |
This file contains 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 | |
str() { | |
foo() { | |
echo "fourty-two" | |
} | |
} | |
int() { | |
foo() { |
This file contains 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
void hex_encode(unsigned char * in, size_t inlen, char * out) { | |
size_t i; | |
for (i=0;i!=inlen;++i, out+=2) { | |
sprintf(out, "%02x", in[i]); | |
} | |
} | |
char digest[16] = "some_random_data"; | |
char buffer[64]; | |
hex_encode(digest, sizeof(digest), buffer); |
This file contains 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 | |
logo=" | |
$(tput setaf 2).~~. .~~.$(tput sgr0) | |
$(tput setaf 2)'. \ ' ' / .'$(tput sgr0) | |
$(tput setaf 1).~ .~~~..~.$(tput sgr0) _ _ | |
$(tput setaf 1): .~.'~'.~. :$(tput sgr0) ___ ___ ___ ___| |_ ___ ___ ___ _ _ ___|_| | |
$(tput setaf 1)~ ( ) ( ) ~$(tput sgr0) | _| .'|_ -| . | . | -_| _| _| | | | . | | | |
$(tput setaf 1)( : '~'.~.'~' : )$(tput sgr0) |_| |__,|___| _|___|___|_| |_| |_ | | _|_| | |
$(tput setaf 1)~ .~ ( ) ~. ~$(tput sgr0) |_| |___| |_| |
OlderNewer