Skip to content

Instantly share code, notes, and snippets.

@dikaio
dikaio / tailwind.config.js
Created April 25, 2023 22:46
HelpScout color pallette for tailwindcss
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [],
darkMode: ["class"],
theme: {
colors: {
transparent: "transparent",
current: "currentColor",
white: "#ffffff",
black: "#000000",
@dikaio
dikaio / README.MD
Created May 19, 2023 22:12 — forked from RichardBronosky/README.MD
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@dikaio
dikaio / remove-between-tags.md
Created June 25, 2023 09:33
Regex to remove anything within tags

You can use the following regular expression to find and remove all text within the <picture></picture> tag in Visual Studio Code:

  1. Press Ctrl+Shift+F or Cmd+Shift+F (on Mac) to open the "Find in Files" panel.

  2. Click on the gear icon to show the search options.

  3. Tick the "Use Regular Expression" checkbox.

  4. In the "Find" field, enter this regular expression:

@dikaio
dikaio / convert.md
Last active July 3, 2023 04:46
Simple one-line command to batch convert jpeg to jpg and keep the same filename.

Simple one-line command argument to batch convert images.

for file in *.jpeg; do filename="${file%.*}"; convert "$file" "${filename}.jpg"; done

@dikaio
dikaio / convert.md
Created July 3, 2023 05:23
One line command to bulk convert image sizes as long as their are greater than the size being converted to.

find . -type f -name "*.jpg" -exec identify -format '%w %i\n' "{}" \; | awk '$1 > 800 {print $2}' | xargs -I {} convert "{}" -resize 800x "{}"

@dikaio
dikaio / aspect-ratio.sh
Created July 14, 2023 11:41
Little Bash Script that crops photos to 5:3 and 3:5 aspect ratios. Perfect ratio's for displaying on the web.
#!/bin/bash
# Path to the folder containing the .jpg photos
folder_path="./photos"
total_files=$(find "$folder_path" -type f -name "*.jpg" | wc -l)
current_file=0
echo "Processing photos..."
@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)"
@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 / 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 / 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,