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
user derek users; | |
worker_processes 1; | |
error_log logs/error.log; | |
# I like to use these two directives for development so I can have server and log in foreground | |
# daemon off; | |
# error_log stderr notice; | |
events { | |
worker_connections 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
local app = lapis.Application() | |
app:match("/my-thing", respond_to { | |
on_error = function(self) | |
-- the view will have access to self.errors | |
return { render = true } | |
end, | |
before = function(self) | |
-- do everything to set up the view, since if we get an error we need to rerender |
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
socket = require "socket" | |
app = require "app" | |
app = app! | |
app.router\build! | |
paths = for route in *app.router.routes | |
route[1]\gsub ":%w+", "1" | |
start = socket.gettime! |
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 test_urls { | |
xargs -n 1 -P 50 curl -s -o /dev/null -w "%{http_code} %{url_effective}\n" | |
} |
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
<iframe src="//itch.io/embed/16866" width="552" height="167" frameborder="0"></iframe> |
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
import to_lua from require "moonscript.base" | |
for i=1,250 | |
print "tick", i | |
to_lua "x = ->" |
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
start <- block space ! . | |
word <- [a-zA-Z_] [a-zA-Z_0-9] * | |
empty_line <- space & stop | |
string_interpolation <- "#{" ( &{ start("interpolation") } exp space "}" &{ accept("interpolation") } / &{ reject("interpolation") } ) | |
while <- &{ start("while") } space "while" [^a-zA-Z_0-9] exp space ( space "do" [^a-zA-Z_0-9] ( &{ start() } statement &{ accept() } / &{ reject() } ) / break body ) &{ accept("while") } / &{ reject("while") } | |
body <- & ( < space > &{ advance_indent(yytext) } ) ( &{ start() } ( line ( break line ) * &{ pop_indent() } / &{ pop_indent() } &{ 0 } ) &{ accept() } / &{ reject() } ) | |
unbounded_table <- &{ start("table") } ( &{ start() } key_value_list &{ accept() } / &{ reject() } ) &{ accept("table") } / &{ reject("table") } | |
line <- < space > &{ check_indent(yytext) } statement / empty_line | |
table_value <- key_value / &{ start() } exp &{ accept() } / &{ reject() } | |
space <- [ \t] * |
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
-- this is how you write specs: | |
import load_test_server, close_test_server from require "lapis.spec.server" | |
import request_with_phantom from require "spec_integration.helpers" | |
describe "integration", -> | |
setup -> | |
load_test_server! | |
teardown -> |
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 | |
scrot '%Y-%m-%d_%H-%M-%S.png' -s -e 'pngquant --ext .png -f $f;scp $f [email protected]:www/shotsnb;echo -n "http://leafo.net/shotsnb/$f" | xclip; rm $f' && notify-send -u normal -t 1000 'Screenshot Ready' |
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
(master) ~/code/cpp/enet-lua > luarocks upload enet-1.2-1.rockspec --api-key=xxx | |
/home/leafo/.luarocks/upload_config.lua | |
Warning: Your LuaRocks is out of date, consider upgrading. | |
Sending enet-1.2-1.rockspec ... | |
Packing enet | |
Cloning into 'lua-enet'... | |
remote: Counting objects: 21, done. | |
remote: Compressing objects: 100% (17/17), done. | |
remote: Total 21 (delta 1), reused 20 (delta 1) | |
Receiving objects: 100% (21/21), 12.58 KiB | 0 bytes/s, done. |