Purpose: Exhaustive implementor-level reference for building, migrating, and maintaining Pulumi Python infrastructure projects using Nix for hermetic dependency management. Replaces pip, uv, virtualenv, and pyproject.toml-based dependency resolution with a single
python.withPackagesderivation that is reproducible, offline-capable, and free of PATH collisions.Audience: Any developer or AI agent with zero prior Nix, pip, uv, or Pulumi knowledge. Every concept is defined from first principles. Every code snippet is complete and
| /** Users of your module possibly never need interfaces in this namespace. But you will. */ | |
| export namespace Configuration { | |
| /** Configuration defaults -> all of these keys are optional for users of your module. */ | |
| export interface Defaults { | |
| /** If set to true, my module will always fail. Default = false */ | |
| alwaysFail: boolean; | |
| } | |
| /** Required configuration options, no defaults are used here */ |
| !! | |
| !! Implementation of JSONPatch (http://jsonpatch.com/) using PostgreSQL >= 9.5 | |
| !! | |
| CREATE OR REPLACE FUNCTION jsonb_copy(JSONB, TEXT[], TEXT[]) RETURNS JSONB AS $$ | |
| DECLARE | |
| retval ALIAS FOR $1; | |
| src_path ALIAS FOR $2; | |
| dst_path ALIAS FOR $3; | |
| tmp_value JSONB; |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
| (require '[schema.core :as s]) | |
| (require '[schema.coerce :as coerce]) | |
| (require '[schema.utils :as utils]) | |
| (defn filter-schema-keys | |
| [m schema-keys extra-keys-walker] | |
| (reduce-kv (fn [m k v] | |
| (if (or (contains? schema-keys k) | |
| (and extra-keys-walker | |
| (not (utils/error? (extra-keys-walker k))))) |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
| ;;; skewer-coffee.el --- skewer support for live-interactive Coffeescript | |
| (defun skewer-coffee-eval (coffee-code) | |
| "Requests the browser to evaluate a coffeescipt string." | |
| ;; XXX should escape double quote characters | |
| (skewer-eval (concat "CoffeeScript.eval(\"" | |
| (s-replace "\n" "\\n" (s-trim coffee-code)) | |
| "\");") | |
| #'skewer-post-minibuffer)) |
A list of tools mentioned in my Ignite talk from Devopsdays Rome 2012 on a continuous packaging pipeline, with links and short description for each tool.
The talk slides are at https://speakerdeck.com/mpasternacki/a-continuous-packaging-pipeline; a longer blog post will be written soon.
Available at https://github.com/3ofcoins/vendorificator/ or with gem install vendorificator
Include third party modules in your git repo, using pristine branches to sanely maintain local changes, upgrades, and merges.
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |