Skip to content

Instantly share code, notes, and snippets.

View kennethd's full-sized avatar

kenneth dombrowski kennethd

  • new york, new york
View GitHub Profile
@kennethd
kennethd / gitweb.perl
Last active January 2, 2024 11:46 — forked from aanoaa/gitweb.perl
#!/usr/bin/perl
# gitweb - simple web interface to track changes in git repositories
#
# (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
# (C) 2005, Christian Gierke
#
# This program is licensed under the GPLv2
use strict;
@kennethd
kennethd / install.sh
Last active January 4, 2024 16:09
bootstrap install script for new python project
#!/bin/bash
RESET="\e[0m"
BOLD="\e[1m"
FGGRN="\e[32m"
FGRED="\e[31m"
FGYEL="\e[33m"
stderr() { echo -e "$0: $*" >&2; }
ok() { stderr "${FGGRN}${BOLD}ok: $*${RESET}"; }
@kennethd
kennethd / __create_angular_project_with_jest_test_runner.txt
Last active September 21, 2023 22:06
create angular project with jest test runner
kenneth@bookworm ~/git/strike-frontend (main) $ git log --reverse --pretty=' %h %s'
f186dec ng new --routing --style css --skip-git --strict --minimal strike-frontend && cd strike-frontend
b18e280 npm install jest jest-environment-jsdom jest-preset-angular @types/jest --save-dev && git add package.json package-lock.json
209a1be update angular.json to use jest for testing
d93391d add tsconfig.spec.json, jest.config.ts, src/test.ts; remove comments to make tsconfig.json & tsconfig.app.json valid JSON
5020742 npm install --save-dev ts-node && git add package.json package-lock.json : Error: Jest: 'ts-node' is required for the TypeScript configuration files. Make sure it is installed
f5ba48b npm install --save-dev ts-jest && git add package.json package-lock.json
d7bb4e8 updated for current version of ts-jest: jest.config.ts src/test.ts tsconfig.json
43fd05c add auto-generated src/app/app.component.spec.ts from prev run of 'ng new' without --minimal... initial 3 tests pass
5234
# apt-cache - query the APT cache
# rdepends shows a listing of each reverse dependency a package has
# --no-suggests omit suggests dependencies
# --no-conflicts omit conflicts dependencies
# --no-breaks omit breaks dependencies
# --no-replaces omit replaces dependencies
# --no-enhances omit enhances dependencies
# --installed limit the output to packages which are currently installed
# --recurse make recursive so all packages mentioned are printed once
@kennethd
kennethd / #Gitolite + Gitweb + lighttpd configs
Last active January 19, 2024 17:42
lighttpd + gitweb config
(this file added in attempt to rename gist from "Dockerfile" per https://stackoverflow.com/a/62398008/1332304)
@kennethd
kennethd / MySet.js
Last active August 1, 2022 20:41
MySet.js
/**
* https://jsfiddle.net/kennethd/baLpf7su/250/
*
* jsfiddle requirements:
* https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js
* https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js
* https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.css
*/
// interface is roughly based on Python's `set` type, just for reason of familiarity
@kennethd
kennethd / Rakefile
Last active April 22, 2022 16:55
synchome rake task
require 'date'
require 'open3'
def run_cmd(cmd)
# run cmd in subshell & return STDOUT
# fails if command exits with non-zero status
# if command produces output on STDERR, echos cmd STDERR to current STDERR
STDERR.puts "run_cmd: #{cmd}"
stdout, stderr, status = Open3.capture3(cmd)
if status.to_s !~ /exit 0/
@kennethd
kennethd / .gitconfig
Created April 19, 2022 16:27
gitconfig
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
# check configs:
kenneth@x1:~/ocrolus$ cat ~/.pip/pip.conf
```ini
[global]
no-cache-dir = false
require-virtualenv = true
index = https://nexus.ocrolus.com/repository/ocrolus-pypi/pypi
index-url = https://nexus.ocrolus.com/repository/ocrolus-pypi/simple
```
@kennethd
kennethd / MiaNYC.md
Last active November 16, 2018 04:30

Museums

  • NYPL Schwarzman Schwarzman Bldg, 42nd & 5th
  • Met You pretty much have to go; it takes at least half a day; I recommend: go early, prioritize what you want to see in advance, bring a sketchbook, spend a few hours, and leave when you get hungry for lunch (i've always made it a point to at least walk through the Egyptian wing)
  • MoMA You really should go, great 20th century collection. Free (but crowded!) Friday evenings. There's a branch in Queens, but I've only been there for events
  • Natural History Museum One of my favorites in the city, but not cheap. I last visited with Lisa & Mark when they were here like 10 years ago
  • NY Historical Society *Always has interesting programs & cool film or lecture events, across the street from AMNH, so you can kill a whole afternoon between the two, maybe with a stroll across Central P