A command line script for grabbing ESPN's latest headlines!
Throw this baby into your $HOME/bin
directory (assuming it exists and is in your $PATH
) and chmod
it to 755
and you'll be cruising!
Dependencies:
im rebellious | |
i dont really do eggs for bfast | |
i dont really like bfast food unless i had a heavy night of drinking |
son, you cant have breakfast without eggs and bacon |
curl -s http://www.cmj.com/marathon/cmj-2014-artists/ | pup .one-half .entry-title text{} | grep -v "Playing CMJ 2014" |
def slope(requestContext, seriesList): | |
""" | |
Graphs the slope of a metric (or metrics) | |
""" | |
results = [] | |
for series in seriesList: | |
name = "slope(%s)" % series.name | |
reversed_data = series[::-1] |
Full writeup:
http://blog.samsandberg.com/2014/11/03/socks-pair-matching/
Usage:
$ python socks.py 3 -n 100000
3 pairs of socks
100000 iterations
{False: 60011, True: 39989}
Question: Convert following into the latter data structure in less than 30 lines: | |
List: | |
A, B, C | |
A, C, E | |
E, F, D | |
D, A, J | |
E, D, J | |
List |
Add this to your virtualenv postactivate
script to store all heroku config variables in your project's .env
file
(Unless you have some custom setup, this file probably lives at ~/.virtualenvs/[project name]/bin/postactivate
Requires heroku-config
package com.example; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import javax.net.ssl.HostnameVerifier; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.SSLSession; | |
import retrofit.client.Request; |
#!/usr/bin/env python | |
# References | |
# http://en.wikipedia.org/wiki/KenKen | |
# https://docs.python.org/2/library/itertools.html | |
import argparse | |
import itertools | |