Skip to content

Instantly share code, notes, and snippets.

@jwc20
jwc20 / index.coffee
Created July 14, 2025 12:00
my Ubersicht widget for displaying Things task
refreshFrequency: 60000
# homeDir = process.env['HOME']
# sqliteDb = homeDir + '/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db'
sqliteDb = '/Users/cjw/Library/Group Containers/JLMPQHK86H.com.culturedcode.ThingsMac/ThingsData-DC8DV/Things Database.thingsdatabase/main.sqlite'
#todaySql = 'select ZTITLE from ZTHING where ZTRASHED=0 AND ZSTATUS=0 AND ZFOCUSLEVEL IS NULL AND ZSCHEDULER =1 AND ZSTART==1 AND ZTYPE=0 ORDER BY ZTITLE ASC'
todaySql = 'select title from TMTask where trashed=0 AND status=0 AND start=1 AND type=0 AND todayIndex<>0 ORDER BY todayIndex asc limit 1'
command: "sqlite3 '#{sqliteDb}' '#{todaySql}' | awk 'BEGIN {print \"\"} {print substr($0,0)\"<br />\"} /^[*]/ {print \"<blockquote><li>\"substr($0,2)\"</li></blockquote>\"} END {print \"\"}'"

nginx for test.example.com

# https://hamidmosalla.com/2022/12/26/how-to-customize-windows-terminal-and-powershell-using-fzf-neovim-and-beautify-it-with-oh-my-posh/
# function prompt {"PS " + (get-location).drive.name+":\...\"+ $( ( get-item $pwd ).Name ) +">"}
function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p ~ "
}
Set-Alias vim nvim
Set-Alias vi nvim
sudo systemctl daemon-reload
sudo systemctl stop 00waasu_scraper.service
sudo systemctl disable 00waasu_scraper.service
sudo systemctl enable --now waasu_scraper.timer
sudo systemctl status waasu_scraper.timer 00waasu_scraper.service
import socket
import csv
import subprocess
import os
with open('urls.txt', 'r') as input_file, open('results.csv', 'w', newline='') as output_file:
reader = csv.reader(input_file)
writer = csv.writer(output_file)
writer.writerow(['URL', 'IP Address'])
@jwc20
jwc20 / .bashrc
Last active April 21, 2024 10:40
export PYTHONPATH=$SCM_PATH/py
SHELL_NAME="\[\033[01;91m\]($name)\[\033[00m\]"
# https://gist.github.com/ckabalan/2732cf6368a0adfbe55f03be33286ab1
# Color codes for easy prompt building
COLOR_DIVIDER="\[\e[30;1m\]"
COLOR_CMDCOUNT="\[\e[34;1m\]"
COLOR_USERNAME="\[\e[34;1m\]"
COLOR_USERHOSTAT="\[\e[34;1m\]"
@jwc20
jwc20 / stitch.py
Created August 19, 2022 07:49
Stitch images vertically
import numpy as np
from PIL import Image
import glob
list_im = glob.glob("*.png")
total_width = 0
total_height = 0
max_width = 0
max_height = 0
min_width = 2000