Skip to content

Instantly share code, notes, and snippets.

View rickumali's full-sized avatar

Rick Umali rickumali

View GitHub Profile
@rickumali
rickumali / README-bash-prompt.md
Last active May 7, 2023 03:46
Examining BASH PROMPT_COMMAND and BASH Prompt Colors
@rickumali
rickumali / README.md
Last active April 12, 2023 00:19
Describes All Packages on Your Debian

Instructions

% ./package-info.sh > packages.txt
Generated rasp-pi-20230411-200532.txt
% wc rasp-pi-*.txt
 1417  1417 23563 rasp-pi-20230411-200532.txt
@rickumali
rickumali / README.md
Last active March 29, 2023 02:28
Starting a Browser in a Swift Script File

This code was originally posted by Jens in:

https://developer.apple.com/forums/thread/5137

He writes "Below is the 'Webkit Browser in 30 Lines of Swift' from Practical Swift, with some small changes to make it run on latest beta with Swift 2."

I have modified it to work on MacOS Big Sur 11.7.4 Swift 5.5.2

# Wordle - https://www.powerlanguage.co.uk/wordle/
# This little program looks up a suitable word given
# state of the puzzle (from 2022-Jan-19)
# RAISE
# BLIMP
# CHICK
# SWIPE
# UNIFY
@rickumali
rickumali / README.md
Created November 7, 2021 13:31
ASCII Code Parser (Python)
@rickumali
rickumali / readdiary.py
Last active August 29, 2021 00:39
This Python randomly selects multiple diary files from my $HOME/diary directory, and displays them for me to read. The $HOME/diary directory contains files with the pattern YYYYMMDD.txt.
#!/usr/bin/python
import argparse
import os
import random
import re
import subprocess
from datetime import date
parser = argparse.ArgumentParser(description='Reads random diary entries', epilog='If --old or --today or --thisday present, any day arguments are ignored')
group = parser.add_mutually_exclusive_group()
@rickumali
rickumali / diary.sh
Last active August 28, 2021 13:27
Small BASH function to enter a diary entry into a timestamped diary file (one file per day)
# This bash function makes a diary command.
# All diary entries are kept in $HOME/diary. Each diary file represents a day
# and the filename is YYYYMMDD.txt
# Each diary entry is preceded by a timestamp. If the diary file doesn't exist,
# the command first makes the diary file, then it appends the timestamp. If the
# diary file exists, then it only appends the timestamp.
# The diary file is edited by vim.
diary () {
filename=$HOME/diary/`date +"%Y%m%d.txt"`;
if [ ! -f $filename ]; then
@rickumali
rickumali / README.md
Last active March 6, 2021 00:38
Redirecting Old HTML to Blogger
@rickumali
rickumali / work_figures.rb
Created April 25, 2015 01:07
Small Ruby to Renumber Figures
#!/usr/bin/env ruby
#
require 'pp'
require 'optparse'
require 'pry'
options={}
options[:verbose] = false
options[:figures_list] = 'master_figure_list.csv'
@rickumali
rickumali / wordwrap.php
Created April 21, 2015 23:09
200 Days of Code: wordwrap.php
#!/usr/bin/php
<?php
// Created for Boston PHP's 200 Days of Code (4/22/2015).
//
// http://www.meetup.com/bostonphp/events/219831339/
//
// See: https://php.net/manual/en/function.wordwrap.php
//
$body1 = <<<EOF