Skip to content

Instantly share code, notes, and snippets.

// https://avelino.xxx/go-vs-python-more-request-per-second/
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", viewHandler)
@avelino
avelino / # ninja - 2017-09-06_14-15-44.txt
Created September 6, 2017 17:16
ninja on macOS 10.13 - Homebrew build logs
Homebrew build logs for ninja on macOS 10.13
Build date: 2017-09-06 14:15:44
@avelino
avelino / # ninja - 2017-09-06_10-56-51.txt
Created September 6, 2017 16:36
ninja on macOS 10.13 - Homebrew build logs
Homebrew build logs for ninja on macOS 10.13
Build date: 2017-09-06 10:56:51
PANIC: interface conversion: interface {} is cinemarknts.Data, not map[string]interface {}
goroutine 7 [running]:
github.com/nuveo/cinemarknotas.poc/vendor/github.com/urfave/negroni.(*Recovery).ServeHTTP.func1(0x1a00028, 0xc42000e148, 0xc420015500)
/Users/avelino/src/github.com/nuveo/cinemarknotas.poc/vendor/github.com/urfave/negroni/recovery.go:41 +0x13a
panic(0x13da820, 0xc4201383c0)
/usr/local/Cellar/go/1.8.1/libexec/src/runtime/panic.go:489 +0x2cf
main.handler(0x1a00028, 0xc42000e148, 0xc42000b500)
/Users/avelino/src/github.com/nuveo/cinemarknotas.poc/main.go:49 +0x10ca
net/http.HandlerFunc.ServeHTTP(0x1467698, 0x1a00028, 0xc42000e148, 0xc42000b500)
/usr/local/Cellar/go/1.8.1/libexec/src/net/http/server.go:1942 +0x44
4 stdOut:
5 {}
6 [{}, {}, {}]
7
8 stdErr:
9 Se for JSON é um erro criado
10 SiteOff = ("Site offline", 404)
11 {"msg": SiteOff[0], "code": SiteOff[1]}
12
13 Se não for JSON, deu erro no processamento logar como "error" no job
function test(){
console.log("123")
settings = { any_kind_of_object: true };
json_str = JSON.stringify(settings);
saveFile('yourfilename.json', "data:application/json", new Blob([json_str],{type:""}));
}
import sys
import beanstalkc
beanstalk = beanstalkc.Connection(host='127.0.0.1', port=11300)
if sys.argv[1] == "fill":
print "Filling"
for i in range(100):
beanstalk.put("hello")
elif sys.argv[1] == "list":
### Keybase proof
I hereby claim:
* I am avelino on github.
* I am avelino (https://keybase.io/avelino) on keybase.
* I have a public key ASAHZgfdQJFUfAJkvMbJNJ-DwV9m8F0EcxDu2r1va_dTAQo
To claim this, I am signing this object:
"""
$ alembic revision -m "Add a column"
"""
revision = 'ae1027a6acf'
down_revision = '1975ea83b712'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'account',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('name', sa.String(50), nullable=False),
sa.Column('description', sa.Unicode(200)),
)
def downgrade():
op.drop_table('account')