Skip to content

Instantly share code, notes, and snippets.

View svallory's full-sized avatar
:bowtie:
Coding like there's no tomorrow

Saulo Vallory svallory

:bowtie:
Coding like there's no tomorrow
View GitHub Profile
@svallory
svallory / Quake-style Hotkey Window for Wezterm.json
Created September 17, 2023 01:31
Quake-style Hotkey Window for Wezterm
{
"title": "Quake-style Hotkey Window for Wezterm",
"rules": [
{
"description": "Launch/show Wezterm if it is not in foreground",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@svallory
svallory / cli-utils.ts
Last active April 14, 2024 05:28
My utilities
import { expandToChalkString } from './template-strings.ts';
const exit = (error: string, code: number = -1) => {
console.info(eval(`expandToChalkString\`${error}\``));
process.exit(code);
}
import type { ForegroundColorName } from 'chalk';
const info = (msg: string, color: ForegroundColorName = 'yellow') => {
@svallory
svallory / .gitignore
Created March 25, 2024 01:57
Node .gitignore
.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
@svallory
svallory / marko-json.d.ts
Last active February 26, 2024 04:03
Types for marko.json and marko-tag.json
/**
* Represents a Marko tag name enclosed in angle brackets.
* Used to define custom Marko tags within a taglib definition.
*/
type TagShorthand = `<${string}>`;
/**
* Represents a shorthand for defining repeated tag within a Marko tag.
*/
type RepeatedTag = `${TagShorthand}[]`;
@svallory
svallory / elephant.html
Last active February 24, 2024 05:00
portal > htmz > htmx (LOL just kidding)
<h2>Elephant</h2>
<p>
Elephants are the largest existing land animals. Three species are currently
recognized: the African bush elephant, the African forest elephant, and the
Asian elephant.
</p>
@svallory
svallory / id_rsa.pub
Created February 4, 2024 16:17
my-pub-key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+IUXKEwgSAjypvuuedx8DqpIQrNtHcLWBFEnc24vWV1BApwDa57+bxAOKNTwk/QTOsmjDjyiiHNx532IW4Yg0+U/S0uFvHIlmpuFRst2rPloMktIPy2gOMXOqRhy8uwheGMP7FhXPZaivTYFJreLu1981ipMl5irhdo++FOU5G2DnSBIN1vqS1fR2zAEy1Nnc1Nabx0W5IoaIdAZJ5Z+I49XXq09pismxa6Mkx9otL6ijU7Jf7cH5RRoGj6BJQk/XuNdWpOCw1hWDOT3n5Gn6BGcdx0AoGD4DzqbNjXR1r9Wmjx26YEgNMC0iZRspKUUJMwhNa3TlA4u9N8RrAR0D saulo@toki.life
@svallory
svallory / debug-tag.marko
Last active January 30, 2024 03:47
Marko Tags API Guide
<lifecycle onMount() {
console.log('Debug Tag', component);
}/>
<return=component/>
@svallory
svallory / README.md
Created October 25, 2021 00:26
Figma Plugin Development Live Reload

Figma Plugin Development Live Reload

  1. Create a run-plugin.sh somewhere in your project
  2. Copy the code from the run-plugin.sh file in this gist
  3. Install nodemon with yarn add --dev nodemon
  4. Add a script in the scripts property of your package.json replacing PLUGIN_CODE_FOLDER by the path to the folder where your plugin code lives
    "scripts": {
    

"livereload": "nodemon --watch PLUGIN_CODE_FOLDER --exec run-plugin.sh"

@svallory
svallory / moon-launch.sh
Created December 21, 2023 23:56
Auto-migrate a monorep to moon
#!/bin/bash
# Check if `proto` is installed, if not, ask for user confirmation to install
if ! command -v proto &>/dev/null; then
echo "Proto is not installed. Do you want to install Proto? (y/N)"
read -r user_confirmation
if [[ $user_confirmation == [yY] ]]; then
# Command to install Proto
echo "Installing Proto..."
curl -fsSL https://moonrepo.dev/install/proto.sh | bash
@svallory
svallory / Deploying Sharetribe to Heroku.md
Last active August 12, 2023 21:09
Deploying Sharetribe to Heroku

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config