A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.
Highly recommended things!
This is my five-star list. These are my favorite things in all the world.
A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★
Attributions:
Edward O'Campo-Gooding's list of questions.
Julia Evans' blog post "Questions I'm asking in interviews".
Thanks to @bmastenbrook, @marcprecipice, @danluu, @kelseyinnis, @zmagg, @graue, and @ircolle for awesome question suggestions (per Julia).
| #!/usr/bin/env python | |
| # | |
| # Very basic example of using Python and IMAP to iterate over emails in a | |
| # gmail folder/label. This code is released into the public domain. | |
| # | |
| # RKI July 2013 | |
| # http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
| # | |
| import sys | |
| import imaplib |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
| # Matthew Jee's (mcjee) solution to the Mancala challenge on the HackerRank Back-to-School Hackathon | |
| def printNextMove(player, player1Mancala, player1Marbles, player2Mancala, player2Marbles) | |
| if player == 1 | |
| mymarbles = player1Marbles | |
| opmarbles = player2Marbles | |
| else | |
| mymarbles = player2Marbles | |
| opmarbles = player1Marbles | |
| end | |
| //============================================================================ | |
| // Name : OctaneCrawler.cpp | |
| // Author : Berlin Brown (berlin dot brown at gmail.com) | |
| // Version : | |
| // Copyright : Copyright Berlin Brown 2012-2013 | |
| // License : BSD | |
| // Description : This is the simplest possible web crawler in C++ | |
| // Uses boost_regex and boost_algorithm | |
| //============================================================================ |
Couldn't find the text of this for a while...
| This content has moved to https://github.com/arachsys/motifxf/ |
| import math | |
| import Image | |
| import Levenshtein | |
| class BWImageCompare(object): | |
| """Compares two images (b/w).""" | |
| _pixel = 255 |