This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pprint import pformat | |
| from typing import Any | |
| from pygments import highlight | |
| from pygments.formatters import Terminal256Formatter | |
| from pygments.lexers import PythonLexer | |
| def pprint_color(obj: Any) -> None: | |
| """Pretty-print in color.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SudokuSolver { | |
| constructor(board) { | |
| this.board = board; | |
| } | |
| solve() { | |
| const index = this.board.indexOf('0'); | |
| if (index === -1) return this.board; | |
| for (let possibility = 1; possibility < 10; possibility++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| from markdown2 import markdown | |
| from xhtml2pdf import pisa | |
| """ | |
| ## Inspired by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| "Automotive", | |
| "Budgeting", | |
| "HVAC", | |
| "Heaters", | |
| "Hydraulics", | |
| "Logistics Management", | |
| "Management", | |
| "Negotiation", | |
| "Project Planning", |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location /webhook/17cbb307-94ec-446b-a17b-ab82594c974c { | |
| if ($request_method != 'POST') { | |
| return 405; | |
| } | |
| content_by_lua 'ngx.print(io.popen("/path/to/script.sh"):read("*a"))'; | |
| } |