Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#-------------------------#
# Set up OpenDNS in macOS #
#-------------------------#
# Set OpenDNS nameservers.
echo "Setting up OpenDNS."
networksetup -setdnsservers Wi-Fi 208.67.220.220 208.67.222.222;

Workflow

See the repository status

git status

Add all files to staging

@chrisullyott
chrisullyott / ConcurrentEventReport.php
Last active April 30, 2021 16:29
Build a CSV file with the distribution of concurrent events across the range of time by minute.
<?php
/**
* Class ConcurrentEventReport
*
* Accepts a two-column CSV file containing a list of events in terms of "start" and "end" times.
* Outputs a new CSV file with the distribution of concurrent events across the range of time by minute.
*/
class ConcurrentEventReport
{
@chrisullyott
chrisullyott / backup.sh
Last active September 3, 2020 14:11
Backup a directory using the current date.
#!/bin/bash
# Backup a directory using the current date.
# First argument: the path of the directory to back up.
# Second argument: the path of the directory to store the archive into.
# Creates a filename like <DIRECTORY>_<DATE>.tar.gz
if [ -z $1 ] || [ -z $2 ]; then
echo "Enter a source directory and a destination directory."
exit 1
@chrisullyott
chrisullyott / 10000-filesizes.txt
Last active June 7, 2019 01:44
10,000 random filesizes.
9.33 MB
5.67 MB
4.53 MB
365 B
942.1 MB
3.47 KB
7 GB
2.78 KB
8.8 GB
4.5 GB
@chrisullyott
chrisullyott / 1000-filesizes.txt
Last active June 7, 2019 01:43
1,000 random filesizes.
4.9 MB
5.72 MB
7.3 GB
4.6 KB
3.7 GB
2.35 KB
4.81 MB
6.3 MB
6.8 MB
1.52 KB
@chrisullyott
chrisullyott / PackageSheet.php
Created December 5, 2017 18:32
Build a spreadsheet of info about a project's required libraries via Packagist (command-line).
#!/usr/bin/php
<?php
/**
* Build a spreadsheet of info about a project's required libraries via Packagist.
*
* @author Chris Ullyott <contact@chrisullyott.com>
*/
class PackageSheet