gaiety / Phoenix (Elixir) + LitElement + TailwindCSS

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Inline import the compiled TailwindCSS and Phoenix LiveView ViewHook and make it available to components
1 import {LitElement, unsafeCSS} from 'lit'
2 import type {ViewHook} from 'phoenix_live_view'
3 import styles from '../../../priv/static/assets/app.css?inline'
4
5 declare global {
6 interface HTMLElement {
7 LitLiveHook?: ViewHook
8 }
9 }

gaiety / randomAlphaNumeric.js

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Great for simple dynamic items, like a dynamic html ID suffix
1 # Returns random a-z0-9 pattern of 9 characters
2 # Example: qhp050kba
3
4 function randomAlphaNumeric() {
5 return Math.random().toString(36).slice(2)
6 }

gaiety / head-tail-trim.sh

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
1 echo foo\nbar\nbaz | head -n 2
2 # foo
3 # bar
4
5 echo foo\nbar\nbaz | tail -n 2
6 # bar
7 # baz

gaiety / bash-word-count.sh

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
1 echo foo bar | wc -w
2 # 2
3
4 echo foo\nbar\nbaz | wc -l # multiple lines
5 # 3

gaiety / docker-reclaimed-space-prune.sh

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Docker system prune with reclaimed space results
1 RESULT=$(docker system prune -a -f | grep "reclaimed space")
2
3 echo "Docker system prune: $RESULT" # Reclaimed space 12GB

gaiety / date-time-bash.sh

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Simple variables for the current date and time, great to include in logs for small scripts
1 currentDate=$(date +"%m_%d_%Y")
2 currentTime=$(date +"%T")
3
4 echo "Hello! It is $currentTime on the $currentDate" >> my-log.log

gaiety / Rsync the Linux Root Dir

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Without the cruft! It's nice to do a partial system root backup of Linux with rsync, this has a lot of excludes already for you.
1 rsync -a \
2 --log-file=$logFile \
3 --exclude=/swap.img \
4 --exclude=/snap \
5 --exclude=/dev \
6 --exclude=/mnt \
7 --exclude=/proc \
8 --exclude=/sys \
9 --exclude=/tmp \
10 --exclude=/var/tmp \

gaiety / userIsTypingStuff.js

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
Hack for JavaScript check to see if the user might be typing somewhere
1 let userIsTypingStuff = document.querySelectorAll('input:focus, textarea:focus').length !== 0;