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 hints = {} | |
| local stdout = io.stdout | |
| local insert = table.insert | |
| local omit = {} | |
| do local _ENV = omit | |
| _G, math, os, package, string, debug, io, table=1,1,1,1,1,1,1,1 | |
| end | |
| return setmetatable({}, {__index=function(t,k) | |
| if hints[k] then return rawget(package.loaded[hints[k]], k) end | |
| for pn,v in pairs(package.loaded) do |
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
| require 'coroutine' | |
| _ENV = require 'ugly' | |
| print(rep('x ',3)) | |
| concat {1,2,3} | |
| insert({},3) |
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 webscale = require "webscale" | |
| -- super secret webscale data | |
| local vars = {} | |
| -- GET/HEAD only | |
| webscale["/"].get = function(req) | |
| return "Hello world" | |
| end |
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
| #define MAX_ARG 10 | |
| #define MAX_VARG 10 | |
| ptrdiff_t ffi_abi_call(ptrdiff_t fp, const ptrdiff_t *args, const ptrdiff_t *vargs, int narg, int nvarg) | |
| { | |
| assert(narg < MAX_ARG && nvarg < MAX_VARG); | |
| switch (narg * MAX_VARG + nvarg) { | |
| case 0*MAX_VARG+0: return ((ptrdiff_t(*)())fp)(); // 0 args, 0 vargs | |
| case 1*MAX_VARG+0: return ((ptrdiff_t(*)(ptrdiff_t))fp)(args[0]); // 1 args, 0 vargs | |
| case 1*MAX_VARG+1: return ((ptrdiff_t(*)(ptrdiff_t,...))fp)(args[0],vargs[0]); // 1 args, 1 vargs |
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
| languageList = { | |
| {"EN", "English"}, | |
| {"FR", "Français"}, | |
| {"RU", "Русский"}, | |
| {"BR", "Português do Brasil"}, | |
| {"ES", "Español"}, | |
| {"CN", "中文"}, | |
| {"TR", "Türkçe"}, | |
| {"SK", "Skandinavisk"}, | |
| {"PL", "Polski"}, |
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 <lua.h> | |
| #include <lauxlib.h> | |
| #include <assert.h> | |
| #define MAXMEM 128*1024 | |
| int mused = 0; | |
| void *alloc(void *ud, void *p, size_t o, size_t n) | |
| { | |
| mused -= o; |
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 <lua.h> | |
| #include <lauxlib.h> | |
| #include <assert.h> | |
| #define MAXMEM 128*1024 | |
| int mused = 0; | |
| void *alloc(void *ud, void *p, size_t o, size_t n) | |
| { | |
| mused -= o; |
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
| require "http_dispatch" | |
| local function pout(s,i,f) | |
| end | |
| local function translate(s) | |
| local res = {} | |
| local start = 1 | |
| s = string.gsub(s, "<%%(.-)%%>", "<?lua %1 ?>") |
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
| /* | |
| * $Id: buf.c,v 1.27 2007-03-06 05:32:09 kt Exp $ | |
| * buffers for large bulk I/O (supported by fs.c and sock.c) | |
| * | |
| * Copyright (c) 2005-2006 Karel Tuma, leet.cz. | |
| * | |
| * This program is free software; you can redistribute it and/or | |
| * modify it under the terms of the GNU General Public License | |
| * as published by the Free Software Foundation; either version 2 | |
| * of the License, or (at your option) any later version. |
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
| ------------------------------------ | |
| -- basic TLS/SSL3.1 implementation | |
| -- $Id: ssl.lua,v 1.13 2006-12-02 21:25:58 kt Exp $ | |
| ------------------------------------ | |
| require "clua" | |
| require "util" |