Skip to content

Instantly share code, notes, and snippets.

@TGIFelix
TGIFelix / style.css
Created Apr 22, 2021
CSS orientation lock
View style.css
@media screen and (min-width: 320px) and (max-width: 767px) and (orientation: landscape) {
html {
transform: rotate(-90deg);
transform-origin: left top;
width: 100vh;
overflow-x: hidden;
position: absolute;
top: 100%;
left: 0;
}
@TGIFelix
TGIFelix / style.css
Last active Apr 19, 2021
CSS Dark Mode
View style.css
@media (prefers-color-scheme: light) {
body {
background-color: white;
color: black;
}
}
@media (prefers-color-scheme: dark) {
body {
background-color: black;
@TGIFelix
TGIFelix / animation.css
Last active Apr 22, 2021
CSS Reduce Motion
View animation.css
@media (prefers-reduced-motion: reduce) {
* {
animation: none !important;
transition: none !important;
}
}
View gist:2773d5a7feae7879ed43a2b358b39db2
npm i --save sass && npm i --save-dev npm-run-all
"scripts": {
"sass": "sass --style=compressed src/style.sass src/_includes/styles.css",
"watch:eleventy": "eleventy --serve",
"watch:sass": "npm run sass -- --watch",
"dev": "npm-run-all sass --parallel watch:*",
"build": "npm run sass && eleventy"
},
@TGIFelix
TGIFelix / install-xcode.sh
Last active Apr 4, 2021
Check if `xcode-select` is installed
View install-xcode.sh
#
# Check if Xcode Command Line Tools are installed
# Usage: curl -sLf https://gist.githubusercontent.com/TGIFelix/f0d09b869566984e1fca6456155580a5/raw/287f691013e2ccb9c66988eb894b4b941e6d4df5/install-xcode.sh | bash
#
which -s xcode-select
if [[ $? != 0 ]] ; then
echo "Installing Xcode Command Line Tools"
# Install Xcode Command Line Tools
xcode-select --install
else
View index.html
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎯</text></svg>">
View ps3.sh
PS3=''
options=("opt1" "opt2" "opt3")
select opt in "${options[@]}"
do
case $opt in
"opt1")
;;
"opt2")