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 perl | |
| use strict; | |
| use warnings; | |
| use Parallel::ForkManager; | |
| my @all_data = qw/hoge fuga foo bar fizz buzz/; | |
| my $pm = new Parallel::ForkManager(3); | |
| for my $data (@all_data) { |
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| \documentclass{article} | |
| \begin{document} | |
| <<names>>= | |
| input$firstname | |
| input$lastname | |
| @ | |
| \end{document} |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| #!/usr/bin/env bash | |
| ## create an ubuntu 14.04 hvm instance, then from your home directory: | |
| # 1. download this script | |
| # wget https://gist.githubusercontent.com/waylonflinn/506f563573600d944923/raw/install-python-data-science.sh | |
| # 2. make it executable | |
| # chmod a+x install-python-data-science.sh |
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import argparse | |
| if __name__ == '__main__': | |
| parser = argparse.ArgumentParser(description=""" | |
| I never freaking remember argparse syntax and the docs are so all over the place | |
| that I need this for an example. |
| #!/bin/bash | |
| # from https://gist.githubusercontent.com/nehalecky/9258c01fb2077f51545a/raw/789f08141dc681cf1ad5da05455c2cd01d1649e8/install-py3-dataproc.sh | |
| apt-get -y install python3 | |
| echo "export PYSPARK_PYTHON=python3" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh | |
| echo "Adding PYTHONHASHSEED=0 to profiles and spark-defaults.conf..." | |
| echo "export PYTHONHASHSEED=0" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh | |
| echo "spark.executorEnv.PYTHONHASHSEED=0" >> /etc/spark/conf/spark-defaults.conf |