> select * from steps where time > '2005-01-01 12:00:00' and time < '2005-01-02 12:00:00'
name: steps
-----------
time user_id value
2005-01-01T12:15:00Z 1234567890 48
2005-01-01T12:30:00Z 1234567890 9
2005-01-01T12:45:00Z 1234567890 31
2005-01-01T13:00:00Z 1234567890 44
2005-01-01T13:15:00Z 1234567890 26
This file contains hidden or 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
# example 1 | |
some_class.some_method(some_paramater1, | |
some_parameter2, | |
some_parameter3) | |
# example 2 | |
some_class.some_method( | |
some_parameter1, | |
some_parameter2, |
This file contains hidden or 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
def _uglify_xml(xml_output): | |
ugly = xml_output.replace(" ", "").replace("\n", "") | |
return ugly | |
def test_xml_basic_building(): | |
d = { | |
'EAI': '11111111', | |
'DBHost': 'BISTEST', | |
'ReferenceId': 'user12345', |
This file contains hidden or 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
def test_xml_basic_building(): | |
d = { | |
'EAI': '11111111', | |
'DBHost': 'BISTEST', | |
'ReferenceId': 'user12345', | |
'Request xmlns="http://www.example.com/WebDelivery" version="1.0"': { | |
'Products': { | |
'PremierProfile': { | |
'Subscriber': { | |
'OpInitials': 'CR', |
This file contains hidden or 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
INFO [alembic.migration] Context impl PostgresqlImpl. | |
INFO [alembic.migration] Will assume transactional DDL. | |
INFO [alembic.migration] Running upgrade None -> 1d8e4022d63b | |
Traceback (most recent call last): | |
File "/usr/local/bin/alembic", line 9, in <module> | |
load_entry_point('alembic==0.3.7dev', 'console_scripts', 'alembic')() | |
File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.7dev-py2.7.egg/alembic/config.py", line 229, in main | |
**dict((k, getattr(options, k)) for k in kwarg) | |
File "/usr/local/lib/python2.7/dist-packages/alembic-0.3.7dev-py2.7.egg/alembic/command.py", line 121, in upgrade | |
script.run_env() |
This file contains hidden or 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
# Test Models.py | |
class Test(Base): | |
__tablename__ = 'test' | |
id = Column(BigInteger, primary_key=True) | |
created_at = Column(DateTime, server_default=text('now()')) | |
created_at2 = Column(DateTime, server_default=text("(now() at time zone 'utc')")) | |
created_at3 = Column(DateTime, server_default=func.now()) | |
### |
This file contains hidden or 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
python manage.py db downgrade | |
python manage.py db migrate -m "new migration scriptz" | |
python manage.py db upgrade |
This file contains hidden or 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
// Build 100000 alphabet dictionaries | |
var dict = {}; | |
for (var i = 0; i < 100000; i++) { | |
dict[i] = {}; | |
for (var c = 65; c < 65+26; c++) { | |
dict[i][String.fromCharCode(c)] = c; | |
} | |
} | |
// Loop through parent and child dictionaries in native JS |
This file contains hidden or 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
<?php | |
/* | |
Author: Eddie Machado | |
URL: htp://themble.com/bones/ | |
This is where you can drop your custom functions or | |
just edit things like thumbnail sizes, header images, | |
sidebars, comments, ect. | |
*/ |