I hereby claim:
- I am mcescalante on github.
- I am mcescalante (https://keybase.io/mcescalante) on keybase.
- I have a public key whose fingerprint is 59F6 7311 E003 5EBE 4A0C D3C3 238D 8F30 A94E F114
To claim this, I am signing this object:
# Select those values, get them to be json | |
c.execute('select * from data') | |
data = c.fetchall() | |
print data | |
# Data will print: [(u'{"test": "test2"}',)] | |
# To load the JSON for python use | |
for item in data: | |
print json.loads(item[0]) | |
# Data will print: {u'test': u'test2'} |
import sqlite3 | |
import json | |
conn = sqlite3.connect('test.db') | |
c = conn.cursor() | |
# Insert {'test':'test2'} dummy values into database | |
c.execute('''insert into data values(?)''',(json.dumps({'test':'test2'}),)) | |
conn.commit() |
import sqlite3 | |
import json | |
conn = sqlite3.connect('test.db') | |
c = conn.cursor() | |
# Insert values | |
c.execute('''insert into data values(?)''', (json.dumps({'test':'test2'}),)) | |
conn.commit() |
I hereby claim:
To claim this, I am signing this object:
#allow mousing | |
set -g mouse-utf8 on | |
set -g mouse on | |
# Return pre-2.1 mousing behaviour | |
# https://github.com/tmux/tmux/issues/145 | |
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" | |
bind -n WheelDownPane select-pane -t= \; send-keys -M | |
# Use vim keybindings in copy mode |
I've had to put cx_Oracle (python Oracle database connector) on macOS and Linux, and both processes were similar but poorly documented on Oracle's website.
These instructions were written and tested using the client 12.1. The instructions for any 12.x are the same, but you may need to change 12_1
to 12_2
in commands if you are using version 12.2, etc.
/* | |
TODO: Rewrite this from scratch | |
TODO: Use this code as an example of how not to code: | |
- no comments | |
- nondescript var names | |
- inline html generation | |
- inline css generation | |
- not keeping a reference to DOM elements | |
- browser checks | |
- code quadruplication (I've never actually seen that before) |
{% macro with_errors(field) %} | |
<div class="form_field"> | |
{% if field.errors %} | |
{% set css_class = 'has_error ' + kwargs.pop('class', '') %} | |
{{ field(class=css_class, **kwargs) }} | |
<ul class="errors">{% for error in field.errors %}<li>{{ error|e }}</li>{% endfor %}</ul> | |
{% else %} | |
{{ field(**kwargs) }} | |
{% endif %} | |
</div> |
#sometimes helpful when reconfiguring /etc/hosts to point locally and browsers are using a cached copy | |
dscacheutil -flushcache |