Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
import bayes | |
import sqlite3 | |
bor = bayes.BayesOnRedis(redis_host='localhost', redis_port=6379, redis_db=0) | |
conn = sqlite3.connect("connotation.db") | |
c = conn.cursor() | |
for row in c.execute('''SELECT * FROM source_data'''): | |
#print "Training..." + row[2] |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
{ | |
"color_scheme": "Packages/Ciapre Color Scheme/CiapreBlack.tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 19.0, | |
"ignored_packages": | |
[ | |
"JSLint", | |
"Vintage", | |
"BracketHighlighter" |
<form id="theform" class="pure-form pure-form-stacked"> | |
<fieldset> | |
<label for="name"> | |
Name: | |
<input type="text" id="name" placeholder="Full Name"/> | |
</label> | |
<label for="address1"> | |
Address: | |
<input type="text" id="address" placeholder="House Number, Street" /> | |
</label> |
# Thanks to Sebastian Kreutzberger | |
# Source: http://www.lecloud.net/post/61401763496/install-update-to-python-2-7-and-latest-pip-on-ec2 | |
# install build tools | |
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
# install python 2.7 and change default python symlink | |
sudo yum install python27-devel -y | |
sudo rm /usr/bin/python | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python |
Here are some resources to help us write better code and recognize code that may need some help.
Backup and restore databases | |
# Backup | |
pg_dump -h <orig db> -U <user> -Fc > data.backup | |
psql in to db... | |
$ drop schema public cascade; | |
$ \connect postgres | |
$ drop database <dbname>; |
$.ajax({ | |
type: "GET", | |
beforeSend: function(request) { | |
request.setRequestHeader("x-referrer", "<your domain here. example.com>"); | |
request.setRequestHeader("x-key", "<your api key here>"); | |
}, | |
url: "https://zip.getziptastic.com/v3/US/48867", | |
success: function(data) { | |
console.log(data); | |
} |
This is a simple way to indicate the best times for a client to contact you via a given medium. This could be used for chat, twitter, skype etc...
TODO: Add in timezone support.
A Pen by Thomas Schultz on CodePen.
<html> | |
<body> | |
<form action="/next_page.php" method="get"> | |
Postal Code: <input type="text" name="postalcode"> | |
<input type="submit"> | |
</form> | |
</body> | |
</html> |