Skip to content

Instantly share code, notes, and snippets.

View nickretallack's full-sized avatar

Nick Retallack nickretallack

View GitHub Profile
@nickretallack
nickretallack / rpc_error.go
Created January 30, 2014 06:49
Run one with --action=serve, and then run another without that.
package main
import (
"flag"
"fmt"
"github.com/tv42/birpc"
"github.com/tv42/birpc/jsonmsg"
"net"
)
@nickretallack
nickretallack / arowtype_test.py
Last active August 29, 2015 13:56
Test cases for my patch to ArrowType.
#!/usr/bin/env py.test
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, Column
from sqlalchemy_utils.types.arrow import ArrowType
import arrow
Base = declarative_base()
@nickretallack
nickretallack / sqlalchemy_time.py
Created February 14, 2014 00:34
SQLAlchemy screws up utc datetimes somehow. The date it inserts is not what I intended.
#!/usr/bin/env py.test
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, Column, DateTime
import arrow
Base = declarative_base()
@nickretallack
nickretallack / console
Created February 14, 2014 00:52
SQLAlchemy screws up utc time.
2014-02-13 16:51:26,231 INFO sqlalchemy.engine.base.Engine select version()
2014-02-13 16:51:26,231 INFO sqlalchemy.engine.base.Engine {}
2014-02-13 16:51:26,232 INFO sqlalchemy.engine.base.Engine select current_schema()
2014-02-13 16:51:26,232 INFO sqlalchemy.engine.base.Engine {}
2014-02-13 16:51:26,234 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
2014-02-13 16:51:26,234 INFO sqlalchemy.engine.base.Engine {}
2014-02-13 16:51:26,235 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
2014-02-13 16:51:26,236 INFO sqlalchemy.engine.base.Engine {}
2014-02-13 16:51:26,236 INFO sqlalchemy.engine.base.Engine show standard_conforming_strings
2014-02-13 16:51:26,236 INFO sqlalchemy.engine.base.Engine {}
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
LOG: unexpected EOF on client connection with an open transaction
@nickretallack
nickretallack / boto_binary.py
Created April 17, 2014 02:18
Binary doesn't work correctly in boto mechanical turk questions.
import boto.mturk.question as q
def test_boto():
binary = q.Binary('image','png','http://example.com/example.png','alt')
overview = q.Overview()
overview.append_field("Binary", binary)
print "Overview:"
print overview.get_as_xml()
print
# XML contains <boto.mturk.question.Binary object at 0x10abd2190>
@nickretallack
nickretallack / sqla_relationship.py
Last active August 29, 2015 14:00
Why shouldn't this work?
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, relationship
Base = declarative_base()
class Parent(Base):
__tablename__ = 'parent'
id = Column(Integer, primary_key=True)
@nickretallack
nickretallack / gist:0f9620d43ca9ae77f267
Created May 24, 2014 19:34
opam install eliom on mac
$ opam install eliom -v
The following actions will be performed:
- install pcre-ocaml.7.0.4 [required by eliom]
- install react.0.9.4 [required by eliom]
- install ssl.0.4.7 [required by eliom]
- install menhir.20130912 [required by eliom]
- install optcomp.1.6 [required by eliom]
- install lwt.2.4.3 [required by eliom]
- install ocamlnet.3.7.4 [required by eliom]
- install deriving-ocsigen.0.5 [required by eliom]
@nickretallack
nickretallack / gist:adbfe2a509312226ab85
Created May 24, 2014 20:06
opam switch install 4.01.0
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c bytecomp/dll.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c bytecomp/dll.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c bytecomp/symtable.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c bytecomp/symtable.ml
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver -I toplevel -c bytecomp/bytelink.mli
boot/ocamlrun boot/ocamlc -nostdlib -I boot -strict-sequence -w +33..39 -warn-error A -I utils -I parsing
@nickretallack
nickretallack / gist:a779f4e6947f5b55f5bb
Created May 24, 2014 20:39
opam install menhir -v
$ opam install -v menhir
The following actions will be performed:
- install menhir.20130912
1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
=-=-= Installing menhir.20130912 =-=-=
Building menhir.20130912:
make install PREFIX=/Users/nick/.opam/system docdir=/Users/nick/.opam/system/doc/menhir libdir=/Users/nick/.opam/system/lib/menhir mandir=/Users/nick/.opam/system/man/man1
rm -f src/installation.ml
echo "let libdir = \"/Users/nick/.opam/system/lib/menhir\"" > src/installation.ml