Skip to content

Instantly share code, notes, and snippets.

@dikaio
dikaio / continents.csv
Last active April 9, 2025 02:38
Continent > Country > Region > City
id name slug
1 Africa africa
2 Americas americas
3 Antarctica antarctica
4 Asia asia
5 Europe europe
6 Oceania oceania
@dikaio
dikaio / settings.json
Last active March 19, 2025 08:47
Visual Studio Code Settings
{
"breadcrumbs.enabled": true,
"colorInfo.languages": [
{
"selector": "css",
"colors": "css"
},
{
"selector": "sass",
"colors": "css"
@dikaio
dikaio / country-dial-codes.json
Last active July 28, 2024 16:33
Country Dial Codes
[
{
"name": "Afghanistan",
"code": "AF",
"emoji": "🇦🇫",
"image": "https://cdn.jsdelivr.net/gh/lipis/[email protected]/flags/4x3/af.svg",
"dialCodes": [
"+93"
],
"slug": "afghanistan"
@dikaio
dikaio / README.md
Created January 6, 2024 15:23
Simple script to optimize images quality, size and format.

How to use

  1. Update the sizes and final format you want your images formatted to in source.
  2. make the script executable chmod +x optimize.sh
  3. run the script ./optimize.sh original.jpg
@dikaio
dikaio / box-shadow.md
Created December 20, 2023 05:29
Realistic Box Shadows

Realistic CSS Shadows

box-shadow: x, y, blur, spread, color

Alpha 5%

box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.05)
box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.05)
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.05)
@dikaio
dikaio / page.tsx
Created December 13, 2023 08:58
Loading Videos on Vercel via Mix
import { preload } from "react-dom";
import { unstable_getImgProps as getImgProps } from "next/image";
type Props = {
playbackId: string;
loading: "lazy" | "eager";
resolution: "SD" | "HD";
};
export default function MuxVideo({ playBackId, loading, loading }: Props) {
@dikaio
dikaio / settings.json
Last active September 1, 2023 21:24
current cursor/vscode settings
{
"window.commandCenter": true,
"workbench.colorTheme": "Moxer Borderline",
"workbench.iconTheme": "moxer-icons",
"typescript.suggest.paths": false,
"javascript.suggest.paths": false ,
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"editor.formatOnSave": true,
@dikaio
dikaio / laptop.local
Created August 22, 2023 01:16
Custom laptop.local for Thoughtbot's laptop script
#!/bin/bash
taps=(
"denji/nginx"
"heroku/brew"
"homebrew-ffmpeg/ffmpeg"
"homebrew/services"
"twilio/brew"
"universal-ctags/universal-ctags"
)
@dikaio
dikaio / fetch-button.tsx
Last active August 15, 2023 23:54
Fetch Random Data in Next.js (App Router)
// Thanks Alex
// https://twitter.com/asidorenko_/status/1691512559923322880?s=61&t=uyXggCFpWOJLCF9RVYpLTw
// `@/components/fetch-button.tsx`
// `next 13.4.16`
'use client'
import { useRouter } from 'next/navigation'
import { useTransition } from 'react'
export function FetchButton() {
@dikaio
dikaio / 01-generate-ed25519-ssh-key.sh
Created July 31, 2023 18:09 — forked from grenade/01-generate-ed25519-ssh-key.sh
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <[email protected]>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"