Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #! /usr/bin/env bash | |
| # Install any build dependencies needed for curl | |
| sudo apt-get build-dep curl | |
| # Get latest (as of Feb 25, 2016) libcurl | |
| mkdir ~/curl | |
| cd ~/curl | |
| wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
| tar -xvjf curl-7.50.2.tar.bz2 |
| import dateutil.parser | |
| import pandas as pd | |
| topic = pd.read_pickle('my_serialized_data') | |
| posts_df = pd.DataFrame(topic['posts'], columns=['id', 'title', 'created_at', 'author_id']) | |
| users_df = pd.DataFrame(topic['users'], columns=['id', 'name']).drop_duplicates(subset=['id']) | |
| posts_df['created_at'] = posts_df['created_at'].apply(lambda x: dateutil.parser.parse(x).date()) |
| import nltk | |
| from nltk.corpus import brown | |
| for category in brown.categories(): | |
| words = brown.words(categories=category) | |
| text = " ".join(words) | |
| filename = category + '.txt' | |
| outfile = open(filename, 'w') | |
| outfile.write(text) | |
| outfile.close() |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
| # --no-check-cerftificate was necessary for me to have wget not puke about https | |
| curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
| #!/usr/bin/env/python | |
| # | |
| # More of a reference of using jinaj2 without actual template files. | |
| # This is great for a simple output transformation to standard out. | |
| # | |
| # Of course you will need to "sudo pip install jinja2" first! | |
| # | |
| # I like to refer to the following to remember how to use jinja2 :) | |
| # http://jinja.pocoo.org/docs/templates/ | |
| # |