Skip to content

Instantly share code, notes, and snippets.

Chris Dzombak cdzombak

Block or report user

Report or block cdzombak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cdzombak
cdzombak / CDZTableViewSplitDelegate.h
Created Jan 4, 2013
Separate concerns. `UIScrollViewDelegate` deals with a container, while `UITableViewDelegate` deals with content. It's often useful to have two different objects manage these concerns, but Cocoa Touch makes it difficult since `UITableViewDelegate` conforms to `UIScrollViewDelegate` and `UITableView` has only one delegate property. `CDZTableViewS…
View CDZTableViewSplitDelegate.h
#import <Foundation/Foundation.h>
@interface CDZTableViewSplitDelegate : NSObject <UIScrollViewDelegate, UITableViewDelegate>
@property (nonatomic, weak) id<UITableViewDelegate> tvDelegate;
@property (nonatomic, weak) id<UIScrollViewDelegate> svDelegate;
- (id)initWithScrollViewDelegate:(id<UIScrollViewDelegate>)scrollViewDelegate tableViewDelegate:(id<UITableViewDelegate>)tableViewDelegate;
@end
View lightweight-healthcheck.sh
#!/usr/bin/env bash
set -u
THING_DESC="dzombak.com"
EMAIL_SUBJECT="[dzombak.com] Website"
LASTSTATUS_FILE="$HOME/.website-healthcheck-status"
EMAIL_TO="chris@example.com"
SMS_TO="+1xxxxxxxxxx"
TWILIO_NUMBER="+1xxxxxxxxxx"
@cdzombak
cdzombak / listening
Created May 31, 2019
simple cross-platform wrapper for lsof/netstat to tell what processes are listening for network connections
View listening
#!/usr/bin/env python3
import argparse
import platform
import subprocess
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
@cdzombak
cdzombak / mastodon-streaming-healthcheck.sh
Created Jun 11, 2019
Mastodon health checks, run every minute via cron on a separate server
View mastodon-streaming-healthcheck.sh
#!/usr/bin/env bash
set -u
NOW=$(date +"%F %T %Z")
OK=
if curl -s https://a2mi.social/api/v1/streaming/health | grep -c OK > /dev/null ; then
OK="1"
else
OK="0"
View sidekiq.chart.sh
# sidekiq.chart.sh by codl <codl@codl.fr>
#
# put this in /usr/libexec/netdata/charts.d
# chown root:netdata and chmod +x
sidekiq_update_every=5
sidekiq_priority=9000
sidekiq_check() {
redis-cli get 'stat:processed' > /dev/null 2> /dev/null
@cdzombak
cdzombak / youtube-dl-wrapper.sh
Last active Apr 12, 2019
youtube-dl wrapper for downloading videos direct to the correct Plex collection on my plex Mac Mini
View youtube-dl-wrapper.sh
#!/bin/bash
# all sorts of more advanced features are available, but this is a start:
# https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template-examples
if [ -z $1 ]; then
echo "Syntax: $0 VIDEO_URL"
exit 1
fi
VIDEO_URL="$1"
View things-to-of.applescript
--------------------------------------------------
--------------------------------------------------
-- Import tasks from Things to OmniFocus
--------------------------------------------------
--------------------------------------------------
--
-- Script taken from: http://forums.omnigroup.com/showthread.php?t=14846&page=2
-- Added: creation date, due date, start date functionality
-- Empty your Things Trash first.
-- Note that this won't move over scheduled recurring tasks.
@cdzombak
cdzombak / README.md
Created Sep 28, 2010
recursive ksort function for PHP
View README.md
@cdzombak
cdzombak / .last-uls-search-hash
Last active Mar 23, 2018
watching for my amateur radio license to appear in the FCC's database!
View .last-uls-search-hash
6be5d57c4d0c622216b38c5ea62195a5
@cdzombak
cdzombak / Drop Action.scpt
Created Jun 3, 2015
OmniFocus AppleScript to move an action to my " Dropped" context and mark it completed.
View Drop Action.scpt
property droppedContext : "Dropped"
tell application "OmniFocus"
tell front document
try
set theDroppedContextID to id of item 1 of (complete droppedContext as context)
set theDroppedContext to first flattened context whose id is theDroppedContextID
on error
display alert "No context found whose name contains “" & droppedContext & ""
return
You can’t perform that action at this time.