After watching Bryan Cantrill's presentation on [Running Aground: Debugging Docker in Production][aground] I got all excited (and strangely nostalgic) about the possibility of core-dumping server-side Python apps whenever they go awry. This would theoretically allow me to fully inspect the state of the program at the point it exploded, rather than relying solely on the information of a stack trace.
This file contains 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 python3 | |
""" | |
This utility will execute the given command (by default, your shell) | |
in a subshell, with an ssh-agent process running and your | |
private key added to it. When the subshell exits, the ssh-agent | |
process is killed. | |
""" | |
# This code was written by Atul Varma in February 2017. It requires |
This file contains 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/python | |
""" | |
This simple script makes it easy to create server certificates | |
that are signed by your own Certificate Authority. | |
Mostly, this script just automates the workflow explained | |
in http://www.tc.umn.edu/~brams006/selfsign.html. | |
Before using this script, you'll need to create a private |
This file contains 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
''' | |
This script makes it easy to create scaffolding for a new | |
NYC-DB dataset based on an input CSV file. Just copy it | |
into the `/src` directory of your NYC-DB repository, | |
open a terminal and run e.g.: | |
python create_dataset.py my_data.csv | |
This will create all the data files and Python code needed | |
for a new dataset called 'my_data' (or whatever you named |
By and large, TypeScript is an incredible tool that I'm very grateful for, but sometimes it really makes me want to tear my hair out.
TypeScript 3.1 introduced a breaking change involving narrowing functions that I have no idea how to work around.
Here's one attempt to make an unconstrained generic into something that's vaguely constrained: I want to define a type T
in which we don't know what properties it has, but we want to make sure that any properties it does have are booleans.
type ObjWithBooleanValues = {
This file contains 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
<header>A Love Bomb From Atul</header> | |
<section> | |
<img src="http://lovebomb.me/templates/atul-files/lovebomb.svg" alt="Love Bomb"> | |
<p>This massive love bomb goes out to <a href="http://en.wikipedia.org/wiki/Tim_berners-lee">Tim Berners-Lee</a> for creating the world's largest <a href="http://en.wikipedia.org/wiki/World_Wide_Web">public resource</a> and working with others to make it as splendid as possible.</p> | |
<aside> | |
</section> |
Here are some mini exercises to challenge your jQuery skills a bit.
Create a new page on jsbin.com and add the following script tag to it:
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
This file contains 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
""" | |
This script can be used to create a sqlite database | |
that contains metadata about all your Gmail messages. | |
You will want to modify IMAP_PASSWORD and IMAP_USERNAME below. | |
See CREATE_TABLE_SQL for the schema of the database. | |
""" | |
import sys |
This file contains 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
var fs = require('fs'); | |
var crypto = require('crypto'); | |
var http = require('http'); | |
var https = require('https'); | |
var async = require('async'); | |
var httpProxy = require('http-proxy'); | |
var _ = require('underscore'); | |
var UID = 1000; | |
var PASSPHRASE = process.env.PASSPHRASE || null; |
This file contains 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
""" | |
This small module makes it easy to bake PNG images with links to | |
Open Badge assertions. It also allows for easy retrieval of the link | |
from baked PNGs. | |
For more information on badge baking, see: | |
https://github.com/mozilla/openbadges/wiki/Badge-Baking | |
Note that this module requires the PyPNG module: |
NewerOlder