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
from __future__ import unicode_literals | |
import sys | |
# We only use unicode in our parser, except for __repr__, which must return str. | |
if sys.version_info.major == 2: | |
repr_str = lambda s: s.encode("utf-8") | |
str = unicode | |
else: | |
repr_str = lambda s: s |
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
- certain endpoints are always blocked | |
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then | |
ngx.exit(403) | |
end | |
-- import requirements | |
local cjson = require "cjson" | |
-- setup some app-level vars | |
local app_id = "APP_ID" |
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
--[[ | |
LUA variant of the php unserialize function | |
Port of http://phpjs.org/functions/unserialize | |
]]-- | |
local function unserialize (data) | |
local function utf8Overhead (chr) | |
local code = chr:byte() | |
if (code < 0x0080) then | |
return 0 |
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
-- name: get_cools | |
SELECT * | |
FROM cools | |
-- name: insert_a_cool | |
INSERT INTO cools | |
(name, why) | |
VALUES | |
(?, ?) | |
RETURNING level |