Greatness is often misattributed to some finite level of ability. People assume others are ahead of them without accounting for the amount of work that person is putting in to achieve their success.
- patience with yourself and persistence with this process. Learning over completion - You just paid over $12,000 to be here. It's not about checking boxes off of a list, it's about learning the materialfrom datetime import datetime | |
from zlib import compress | |
def serialize(x): | |
if isinstance(x, dict): | |
return '<<' + '\n'.join(serialize(k) + ' ' + serialize(v) for k, v in x.items()) + '>>' | |
if isinstance(x, list): | |
return '[' + ' '.join(serialize(it) for it in x) + ']' | |
return str(x) |
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask.ext.httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): |
gem "resque", :require => 'resque/server' | |
gem 'resque-history' |
by Dan Nguyen @dancow
tl;dr: a quick example of practicing reproducible data journalism, and somewhat timely given the recent school vaccination law signed by California Gov. Jerry Brown
These are scripts that are part of the mundaneprogramming.github.io repo for SRCCON 2015 and will soon have their own entry/explanation on that site. They aren't meant to be best/canonical practices (e.g. I felt like using csv.DictWriter so there it is), nor do I guarantee that they work. But you're free to run them to see what happens. All they currently do is download the relevant spreadsheets and compile them into a file, which ends up being one of the most tedious parts of the entire investigation due to how the [files are organized on the home
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # install HomeBrew | |
brew tap caskroom/cask # install Cask | |
brew cask install virtualbox # install VirtualBox | |
brew install docker docker-machine # install Docker and Docker-machine | |
docker-machine create --driver virtualbox default # create a Docker VM named "default" | |
eval $(docker-machine env default) # set env var to tell Docker client to talk to our VM | |
docker version # Docker works, yay! | |
brew tap redspread/spread # tell HomeBrew where Spread is | |
brew install kubectl spread # install Kubectl and Spread | |
spread cluster start # ask Spread to start a k8s cluster with Docker client settings |
from contextlib import ExitStack | |
d = {index: str(index) for index in range(100)} | |
with ExitStack() as stack: | |
for key in d: | |
if key % 13 == 0: | |
stack.callback(d.pop, key) | |
print(d) |
I recently interviewed 4 developers for a Python programming position
They all knew how to use requests
, call APIs and worked either with Django or Flask, but I saw all of them ignoring most of Python’s specific control flow.
Here are two of them, try/except/else/finally
and for/else
:
try:
# What you want to do, which might