This article is now published on my website: A one-off git repo server.
| #!/bin/bash | |
| # | |
| # Steam installer for Debian wheezy (32- and 64-bit) | |
| # | |
| # Place into empty directory and run. | |
| # | |
| download() { | |
| local url="$1" | |
| local filename="$(basename "$url")" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| @admin_api.route('/help', methods=['GET']) | |
| def routes_info(): | |
| """Print all defined routes and their endpoint docstrings | |
| This also handles flask-router, which uses a centralized scheme | |
| to deal with routes, instead of defining them as a decorator | |
| on the target function. | |
| """ | |
| routes = [] | |
| for rule in app.url_map.iter_rules(): |
key is pretty much crucial for state perservation in React. As of React 0.13 it can't do the following things:
- Clone state
<Comp key={1} /><Comp key={1} />- Preserve component state across different parents:
| #!/usr/bin/env python3 | |
| # vim: sw=4 ts=4 et tw=100 cc=+1 | |
| # | |
| #################################################################################################### | |
| # DESCRIPTION # | |
| #################################################################################################### | |
| # | |
| # Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to | |
| # compress e. g. bookmark backups (*.jsonlz4). | |
| # |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
-
nix-channeland~/.nix-defexprare gone. We'll use$NIX_PATH(or user environment specific overrides configured vianix set-path) to look up packages. Since$NIX_PATHsupports URLs nowadays, this removes the need for channels: you can just set$NIX_PATHto e.g.https://nixos.org/channels/nixos-15.09/nixexprs.tar.xzand stay up to date automatically. -
By default, packages are selected by attribute name, rather than the
nameattribute. Thusnix install hellois basically equivalent tonix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default)hellowon't be upgraded tohelloVariant.@vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g.
firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.
TBD: How to deal with search path clashes.