Skip to content

Instantly share code, notes, and snippets.

@cpburnz
cpburnz / Brother_DCP-L2540DW_on_Arch_Linux.rst
Last active July 23, 2023 18:36
Brother DCP-L2540DW on Arch Linux

Brother DCP-L2540DW on Arch Linux

Printer

The printer driver can be installed with the brother-brgenml1 AUR package.

@cpburnz
cpburnz / TLS_certificates.rst
Last active September 25, 2023 00:50
TLS (SSL) certificate notes.

TLS (SSL) Certificates

Note

TLS is the successor to SSL but may still be incorrectly referred to as SSL.

Certificate Authority

@cpburnz
cpburnz / Grep_files_from_stdin.sh
Last active August 29, 2015 14:05
From a bash shell, grep file names received from STDIN. The file names may contain spaces.
#!/bin/bash
#
# From a bash shell, grep file names received from STDIN. The file names may
# contain spaces.
#
# Author: Caleb P. Burns
# License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# Version: 1.0.0
# 1. Find the files to grep.
@cpburnz
cpburnz / Git_notes.rst
Last active April 26, 2017 16:25
Git notes.

Git Notes

Staging

File status

@cpburnz
cpburnz / Execute_command_foreach_line.sh
Last active August 29, 2015 14:02
From a bash shell, store new-line separated strings into a variable, and execute a command for each line.
#!/bin/sh
#
# From a bash shell, store new-line separated strings into a variable, and
# execute a command for each line.
#
# Author: Caleb P. Burns
# License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# Version: 1.0.0
# Enter new-line separated strings into $LINES.
@cpburnz
cpburnz / Datetime_with_timezone.py
Last active August 29, 2015 14:02
How to create time-zone aware date-time instances.
# coding: utf-8
"""
How to create time-zone aware date-time instances.
"""
__author__ = "Caleb P. Burns"
__license__ = "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication"
__version__ = "1.0.1"
import datetime
@cpburnz
cpburnz / Natural_sort.js
Last active August 29, 2015 13:58
A natural sort comparison function for use with Array.prototype.sort().
/*!
This Gist provides a natural sort comparison function for use with
`Array.prototype.sort()`.
Author: Caleb P. Burns
License: CC BY-SA 3.0 <http://creativecommons.org/licenses/by-sa/3.0/>
Version: 1.0.1
Source: <https://gist.github.com/cpburnz/9975800>
Note: This is derived from the natural sort implementation by thg435 <http://stackoverflow.com/users/989121/thg435>
posted at <http://stackoverflow.com/a/15479354/369450>.
@cpburnz
cpburnz / Get_system_from_CPython_and_Jython.py
Last active August 29, 2015 13:57
Reliably determine the name of the host system in both CPython and Jython.
# coding: utf-8
"""
Reliably determine the name of the host system in both CPython and
Jython.
"""
__author__ = "Caleb P. Burns"
__license__ = "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication"
__version__ = "1.0.2"