Skip to content

Instantly share code, notes, and snippets.

View dulldesk's full-sized avatar

dulldesk

View GitHub Profile
@dulldesk
dulldesk / !docker_x11_c++.md
Last active March 12, 2024 20:19
docker x11 c++

build:

docker build . -t fooey

run:

docker run -it --rm -e DISPLAY=10.0.0.231:0.0 fooey
@dulldesk
dulldesk / word-count.jsx
Created October 2, 2022 19:23
Adobe Illustrator script to count the number of words in the document
//@target illustrator
// app.preferences.setBooleanPreference('ShowExternalJSXWarning', false);
const app_dir = app.activeDocument.path;
function main() {
if (!documents.length) {
alert('Error\nOpen a document and try again');
return;
}
@dulldesk
dulldesk / ls-dir-size.ps1
Created June 25, 2022 19:46
list directories by size in powershell
ls -dir | % {[pscustomobject]@{Name=$_; Size=(ls $_ -rec -file | measure Length -Sum | select -exp sum)}} | sort -prop size -desc
@dulldesk
dulldesk / _table-to-csv.js
Created January 25, 2022 00:23
Converts an HTML table to a CSV
function tableToCSV(elm="table",name="table") {
if (!(elm instanceof HTMLElement)) elm = document.querySelector(elm);
const data = new Array(...elm.getElementsByTagName("tr")).map(row => new Array(...row.querySelectorAll("td,th")).map(cell => cell.textContent.trim()).join(",")).join("\n");
const csv_blob = new Blob([data], {type: "text/csv"});
const url = URL.createObjectURL(csv_blob);
let tmp = document.createElement("a");
tmp.download = name + ".csv";
tmp.href = url;
@dulldesk
dulldesk / pomodoro.ps1
Last active January 19, 2023 06:00
PowerShell Pomodoro timer
function Start-Pomodoro {
param(
[int]$work=20,
[int]$break1=5,
[int]$break2=15,
[Alias("Silent")][switch]$mute=$false
)
$yellow = "Yellow"; if ($env:WT_SESSION) {$yellow = "DarkYellow"}
clear

Keybase proof

I hereby claim:

  • I am dulldesk on github.
  • I am dulldesk (https://keybase.io/dulldesk) on keybase.
  • I have a public key ASC-qFyG_blNro4VLPXr7NcqqGDcONVu_ebGuiWSyZKBHAo

To claim this, I am signing this object:

@dulldesk
dulldesk / check-recycle-bin-size.ps1
Last active August 14, 2020 15:18
PowerShell script to check the current user's recycle bin size
Write-Host $env:username 'Recycle Bin size' -fore cyan
$sid = (gwmi win32_useraccount | ? {$_.name -eq $env:username}).SID
$sm = (ls -recurse ("C:\`$recycle.bin\$sid") -force -EA SilentlyContinue | measure -property length -sum).sum
Write-Host ($sm / 1GB) "GB"
Write-Host ($sm / 1MB) "MB"
Write-Host " "
pause