Skip to content

Instantly share code, notes, and snippets.

View mikaelhadler's full-sized avatar
🌻
Make your reality

Mikael Hadler mikaelhadler

🌻
Make your reality
View GitHub Profile
{
"scripts": {
// ...
"db:migrate:up": "bun run -r dotenv/config ./src/lib/db/migrate latest",
"db:migrate:down": "bun run -r dotenv/config ./src/lib/db/migrate down",
"db:migrate:create": "bun run -r dotenv/config ./src/lib/db/migrate create initial",
"db:generate:types": "bunx kysely-codegen --out-file=src/lib/db/schema/Database.ts",
},
"dependencies": {
"kysely": "^0.27.3",

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

#!/bin/bash
# bash script that can setup environment with common linting and testing tools
yes="${@}"
function yes_or_no {
if [[ $yes == "-y" ]]; then
echo "🛑👍🛑 !!! skipping question !!! 🛑👍🛑"
else
@mikaelhadler
mikaelhadler / index.js
Last active July 16, 2020 13:27
Nuxt.js problems mailchimp
import Head from 'next/head'
import { useState } from 'react';
const Home = (props) => {
let [email, setEmail] = useState('');
const handleChange = (event, set) => set(event.value)
const addSubscribe = async () => {
#!/bin/bash
unsplash_user=$1
if ! [ -x "$(command -v feh)" ]; then
echo 'Error: feh is not installed.' >&2
exit 1
fi
if ! [ -x "$(command -v wget)" ]; then
echo 'Error: wget is not installed.' >&2
#!/usr/bin/env bash
# screenshots stuff
# TODO: docs
function help_and_exit {
if [ -n "${1}" ]; then
echo "${1}"
fi
cat <<-EOF
const handleOpenPdf = url => {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
" vim-bootstrap
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
let g:vim_bootstrap_langs = "html,javascript,python"
let g:vim_bootstrap_editor = "vim" " nvim or vim
@mikaelhadler
mikaelhadler / oh-my-zsh-script.md
Last active April 20, 2020 15:26
Instalação oh-my-zsh

Instalação oh-my-zsh

Instalação do zsh é requerida, não esqueça :)

$ sudo apt install zsh

Caso você não tenha o curl instalado, instale com o comando abaixo:

@mikaelhadler
mikaelhadler / init.vim
Last active March 6, 2020 19:14
NVim config for web development
call plug#begin("~/.vim/plugged")
" Theme
Plug 'mhartington/oceanic-next'
" Language Client
Plug 'neoclide/coc.nvim', {'branch': 'release'}
let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier']
" File Explorer with Icons
Plug 'scrooloose/nerdtree'
Plug 'ryanoasis/vim-devicons'