Skip to content

Instantly share code, notes, and snippets.

View Lucent's full-sized avatar

Michael Dayah Lucent

View GitHub Profile
@Lucent
Lucent / avocado-oil.md
Last active August 9, 2026 06:42
Likely oils used in avocado- and olive-oil-labelled chips

Likely oils used in avocado- and olive-oil-labelled chips

Source study: Natalie Lopez-Alvarez, Xueqi Li, Benjamin Vizgordiski, and Selina C. Wang, “Authenticity of avocado and olive oils used as ingredients in commercially processed foods,” Applied Food Research 6 (2026), 102389.

Result

The dominant undeclared oil was almost certainly high- or mid-oleic sunflower oil, not canola oil. Only two of the 28 avocado-oil-labelled chip lots—samples 6 and 9—look essentially authentic.

@Lucent
Lucent / export_to_text.sh
Created January 3, 2026 23:39
tweets.js from Twitter export displayed as plain text prefixed with date/time
#!/usr/bin/env bash
set -Eeuo pipefail
sed '1 s/^[^[]*\[/[/' "$1" |
jq -r '
def sortable_date:
.tweet.created_at
| strptime("%a %b %d %H:%M:%S %z %Y")
| mktime
| . - 18000
@Lucent
Lucent / substack_draft_timeline.js
Last active November 18, 2025 09:27
Fetches Substack draft save times and bins them into configurable N-minute chunks, and prints one ASCII line per day showing active vs idle periods
// Substack versions → per-day ASCII timeline + multi-scale totals +
// fractal dimension (D) + 5s-resolution "true" writing time estimate.
// Paste into console on a /publish/post/{id} page.
(async () => {
const CHUNK_MINUTES = 5; // bucket size for DISPLAY + legacy total
const START_HOUR = 8; // display window start (local)
const END_HOUR = 2; // display window end (next day, local)
const ACTIVE_CHAR = "━"; // writing
const INACTIVE_CHAR = "·"; // idle

openpgp4fpr:3057B3A23A272B93408E34C4ADFE984091983F93

@Lucent
Lucent / routing.md
Last active August 30, 2023 22:05
Fantasy of Trees Teardown Routing

As early as possible

  • Obtain a list of all possible items that can be sold and their creators from Teresa Booth.

Throughout the show

  1. As items are sold, mark them off on master list as either pick-up or delivery.
  2. Enter each delivery item into Microsoft Streets & Trips and rename the pushpin as the code with no leading zeros (A-9 vs A-009). Include pick-up items if purchased with deliverable trees (A-9, TT-5, D-15).
  3. Change pushpins to icons for numbers 1-10 for cardinal directions.

At teardown

  1. Saturday A.M. walk the showroom floor and find every item not marked as sold for delivery or pickup.
@Lucent
Lucent / lightroom-sync.md
Last active January 14, 2025 16:18
Lightroom CC/Cloud and Lightroom Classic synchronization

How to use Classic and keep a cloud backup of full-size originals and videos

I have no interest in organizing using CC's Collections and prefer to use folder hierarchy from Classic.

  • Keep Import folder separate to catch problems! Preferences, Lightroom Sync, Location, Specify location for Lightroom's Synced images
  • Set Catalog Settings > Metadata > Automatically write changes into XMP so removing from Classic to add back some data is recovered
  • Video edits don't propagate, but if added to CC first, they can be moved among synced Collections

https://community.adobe.com/t5/lightroom-classic-discussions/persistent-sync-issues-in-lightroom-classic-with-dng-and-tif/m-p/13163319

@Lucent
Lucent / wake-up.bas
Created November 30, 2019 22:49
Use modem for wake-up call
CLS
WakeupTime$ = "11:02:00"
OPEN "COM1:9600,N,8,1,BIN" FOR OUTPUT AS #1 ' Open the COM port
LOCATE 10, 10, 0: PRINT "Current Time: ";
LOCATE 11, 10, 0: PRINT " Wakeup Time: "; WakeupTime$;
DO
LOCATE 10, 24, 0: PRINT TIME$;
@Lucent
Lucent / debian-8-jessie-efi-nvme.sh
Created November 29, 2019 23:26
Install Debian 8 Jessie on NVMe disk in UEFI mode
# Must use DVD or netinst images. CD image does not boot into UEFI mode.
# Disable CSM in BIOS.
# Clear secure boot keys.
# Expert install
# Alt+F2 to open shell
cd /target
mount --rbind /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
@Lucent
Lucent / bash_utilities.sh
Last active July 5, 2023 00:35
Useful bash one-liners
# Remove all empty folders
find . -maxdepth 1 -type d -empty -print0 > empty.txt; xargs -0 rmdir < empty.txt
# Remove empty folders 2 levels deep, and their parent
find . -maxdepth 2 -type d -empty > empty.txt; rmdir $(<empty.txt)
find . -maxdepth 1 -type d -empty > empty.txt; rmdir $(<empty.txt)
# Move all folders with certain name into their own named folder
find -maxdepth 2 -name 'lavajava' -printf '%h\n' > lavajava.txt; mkdir lavajava; mv $(<lavajava.txt) lavajava/
@Lucent
Lucent / journal_search.php
Created August 19, 2018 04:11
Search and cleanup LiveJournal entries
<?php
if ($_GET["password"] != "password") { ?>
<p>Private search feature. Intrusion logged.</p>
<?php
return; }
set_time_limit(300);
$journal_dir = "C:\documents and settings\michael dayah\my documents\lj backup";
$username = "lucent";
$entry_array = array ();