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
require 'breeze' | |
-- declare class | |
FooHandler = class('FooHandler', ActiveHandler) | |
-- constructor | |
function FooHandler:initialize() | |
-- call base class constructor | |
ActiveHandler.initialize(self) |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"sort" | |
"strconv" | |
"strings" | |
) |
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 | downloads | |
-----------------------+----------- | |
luafilesystem | 8267 | |
say | 8214 | |
moonscript | 7993 | |
ansicolors | 7849 | |
lua_cliargs | 7753 | |
dkjson | 7661 | |
luassert | 7457 | |
alt-getopt | 7401 |
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 _annotate() { | |
echo "$(tput setaf 4)>>$(tput sgr0) $@" | |
eval $@ | |
} | |
function gup() { | |
branch=$([[ -n "$1" ]] && echo "$1" || git rev-parse --abbrev-ref HEAD) | |
dirty=$(git diff --shortstat 2> /dev/null | tail -n1) | |
_annotate git fetch || return |
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
error_log stderr notice; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
variables_hash_max_size 1024; |
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
When you buy something the percentage you paid above the minimum is stored with | |
the purchase. When checking to see if purchase has access to a file with a | |
separate minimum price the percentage above is applied to the current minimum | |
price to calculate "effective purchase pirce". | |
For example, you have a game for 5 dollars, and a bonus file at 10 dollars. | |
A user buys the game for 10 dollars to get the extra download. |
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
module.exports = function(grunt) { | |
var pages = grunt.file.readJSON("data/pages.json"); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON("package.json"), | |
assemble: { | |
options: { | |
layout: "templates/layout.hbs", | |
dad: "hello world", |
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
http://itch.io/api/1/KEY/my-games/graphs?num_days=30 | |
`num_games` optional, defaults to 7. | |
Fetches graph data for the past `num_days`. Days with 0 don't have entries. | |
{ | |
"purchases":[ | |
{ | |
"date":"2014-04-08", |
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
-- LuaJIT 2.1.0-alpha 27c453e | |
-- jit.off() -- no error when jit is off | |
local t = { | |
msg = "hello", | |
} | |
local function breaks(parts) | |
local out = "" | |
if parts.msg then |
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
-- vacuum and analyze stats | |
SELECT relname, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze FROM pg_stat_user_tables; | |
-- scan vs index rate | |
select relname, seq_scan, idx_scan, round(seq_scan::numeric/(seq_scan + idx_scan),4) ratio | |
from pg_stat_user_tables order by ratio desc; |