Skip to content

Instantly share code, notes, and snippets.

View ttonyh's full-sized avatar

Tony Habash ttonyh

  • Los Angeles, CA
View GitHub Profile
@ttonyh
ttonyh / esp32_ttgo_t5_213.yaml
Created January 13, 2024 20:00 — forked from TheGroundZero/esp32_ttgo_t5_213.yaml
TTGO T5 v2.3.1 2.13" display in ESPHome
# Board
# https://s.click.aliexpress.com/e/_9IDl91
# ESPHome docs:
# - https://esphome.io/components/display/waveshare_epaper.html
# - https://esphome.io/components/spi.html#spi
# - https://esphome.io/components/display/index.html#formatted-text
substitutions:
esphome_name: esp32_ttgo_t5
choco list --limit-output
# Extract name and find corresponding winget package
| ForEach-Object -Parallel {
$chocoName = $_.Split('|')[0]
Get-WinGetPackage $chocoName -Count 1 |% {
@{
'chocoName' = $chocoName
'wingetPackage' = $_.Name
}
}
@ttonyh
ttonyh / lodash-assignIn-merge-defaults-diff.js
Created December 14, 2023 00:49 — forked from goldo/lodash-assignIn-merge-defaults-diff.js
Differences between .assignIn(), .assign, .merge(), defaults() and defaultsDeep()
// Tests with Lodash 4.16.4
// Thanks to http://stackoverflow.com/questions/19965844/lodash-difference-between-extend-assign-and-merge
_.assignIn ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.merge ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'bb' }
_.defaults ({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
_.defaultsDeep({}, { a: 'a' }, { a: 'bb' }) // => { a: 'a' }
---
@ttonyh
ttonyh / r-deepin-i-kde.txt
Created September 5, 2023 00:53 — forked from yudi-matsuzake/r-deepin-i-kde.txt
remove deepin install kde
sudo pacman -Rsun deepin deepin-desktop-base deepin-wm deepin-extra lightdm deepin-manjaro
sudo pacman -S plasma kio-extras kde-applications manjaro-kde-settings sddm-breath-theme manjaro-settings-manager-knotifier manjaro-settings-manager-kcm
sudo systemctl enable sddm.service --force
/usr/bin/cp -rf /etc/skel/. ~
@ttonyh
ttonyh / alarm
Created August 6, 2023 19:36 — forked from Misko-2083/alarm
alarm script
#!/bin/bash
# Fancy alarm Misko_2083 @ 2020
# Requires: at, xfce4, wmctrl, xdotool, yad 0.42 (with html dialog), mpv
#########################
# Begin User Interface #
#########################
# JavaScript, HTML and CSS
@ttonyh
ttonyh / reset_kde.txt
Created December 26, 2022 20:41 — forked from Sparklytical/reset_kde.txt
reset kde
Note: don’t try to delete the KDE folders when you’re logged into KDE , it will yield unsatisfactory results.
Below are the steps I took to clean up :
cd ~/
rm -rf .kde
rm -rf .cache/plasmashell*
rm -rf .cache/org.kde.dirmodel-qml.kcache
rm -rf .cache/kioexec/ .cache/krunner/ .cache/ksycoca5*
rm -rf .cache/krunnerbookmarkrunnerfirefoxdbfile.sqlite
rm -f .config/plasma*
@ttonyh
ttonyh / npmTimeMachine
Created December 8, 2021 13:18 — forked from vividn/npmTimeMachine
npmTimeMachine
#!/usr/bin/env bash
# npmTimeMachine
# Quickly get package versions where they would have been on a certain date
# Can be useful for getting out of dependency hell by slowly working your way forward in time
# as if you had stayed up to date in the first place.
#
# The script will run and find the appropriate package versions based on public npm publish data
#
# Usage:
@ttonyh
ttonyh / index.html
Created August 22, 2021 14:44
ThreeJS Example Simple Export Cube from Blender
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
#!/usr/bin/env sh
while true; do
read -p "Are you sure you want to wipe out Docker containers? [y/N]: " yn
case $yn in
[Yy]* ) docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); break;;
[Nn]* ) exit;;
* ) exit;;
esac
done
@ttonyh
ttonyh / create-django-starterproj
Last active July 11, 2021 20:03
Quick-start Django project using Docker
#!/usr/bin/env bash
# REF: https://docs.docker.com/samples/django/
DIR=$1
PROJ_NAME=$2
USER_ID="$(id -u)"
GROUP_ID="$(id -g)"