Skip to content

Instantly share code, notes, and snippets.

@bradyemerson
bradyemerson / al2023-install-docker.md
Last active April 30, 2024 12:44 — forked from thimslugga/01-setup_docker_al2023.md
Amazon Linux 2023 - Install docker and docker-compose

Install Moby / Docker CE

sudo dnf install -y git docker containerd cni-plugins container-selinux udica
sudo usermod -aG docker ec2-user
sudo systemctl enable --now docker

Install docker-compose

@omasanori
omasanori / gist:7858569
Last active April 30, 2024 12:43
Rustのパターンマッチの話

Rustのパターンマッチの話

既に穴だらけですが、やれるだけやっていきます。今回はパターンマッチの話です。

TL;DR(経験者向け)

はい、あなたのよく知るパターンマッチです。ガードも使えますが、他の言語でガードを使うパターンの一部はOCamlのorパターンと同等の機能や範囲を表す機能によって置き換えることができます。

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 30, 2024 12:40
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 30, 2024 12:39
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@FADHILI-Josue
FADHILI-Josue / gist:19f3380e249e1b7a4a702384f91215ea
Last active April 30, 2024 12:35
best dev snippet for creating a react typescript native functional component
"Typescript React native Function Component": {
"prefix": "nfc",
"body": [
"import { FC } from 'react';",
"import { Text, View } from 'react-native';",
"",
"interface ${TM_FILENAME_BASE}Props {",
" $1",
"}",
"",
@fstorr
fstorr / how-to-get-speech-output-as-text-from-screen-readers.md
Last active April 30, 2024 12:32
How to get speech output as text from screen readers

How to get speech output as text from screen readers

Sometimes you need text, rather than voice, output from screen readers. Why? It's really useful for bug reports ("this disclosure icon is announced as 'black dash triangle dash filled dash x2 underscore final dot png' and needs alt text"). Luckily, getting this text is easy to do.

VoiceOver on MacOS

In VoiceOver you press Option + Control + Shift + C to have the last item that was announced copied to the clipboard. Bonus feature: pressing Option + Control + Shift + Z to save the last phrase to the desktop as an audio file.

VoiceOver on iOS

A three-finger quadruple tap copies the last announcement to the clipboard.

@tommorris
tommorris / examples.mkd
Last active April 30, 2024 12:32
OSA JavaScript recipes

For a while, you've been able to script Mac OS using JavaScript using JavaScript for Open Scripting Architecture (JSOSA). This is a huge improvement on AppleScript. Why? JavaScript isn't a great language, but it broadly follows the conventions that programming languages of the C/ALGOL family have followed for decades. AppleScript is a horrendous mess that should never have come into being.

Let's compare.

set x to 0
set taskName to the name of task
@ghostrider-05
ghostrider-05 / discord_app_protocols.md
Last active April 30, 2024 12:30
An unofficial list of discord app protocol routes

Discord app protocol routes

Home:

  • /: discord://-/
  • friends: discord://-/channels/@me/
  • nitro: discord://-/store
  • shop: discord://-/shop
  • message requests: discord://-/message-requests
  • family centre: discord://-/family-center