Skip to content

Instantly share code, notes, and snippets.

@eduardoarandah
eduardoarandah / a.vim
Created August 24, 2022 20:42
Close all empty buffers with this function
function! CloseEmptyBuffers()
let buffers = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val)<0 && !getbufvar(v:val, "&mod")')
if !empty(buffers)
exe 'bw ' . join(buffers, ' ')
endif
endfunction
command! CloseEmptyBuffers :call CloseEmptyBuffers()
@eduardoarandah
eduardoarandah / init.lua
Last active July 6, 2022 17:50
vim to neovim migration helper
-------------------------------------------------------------------------------------
-- 1) Copy this file anywhere,
-- 2) Paste your options in "opts"
-- 3) Source it with :source %
--
-- If you get "unknown option" then remove it from opts and put it in "globals"
--
-- checkopts() checks for values that already are defaults. Remove this function when you're done
-- checkglobals() the same but for globals
--
version: "3.8"
volumes:
mysql57:
name: mysql57
mysql57conf:
name: mysql57conf # docker run -it -v mysql57conf:/app --rm busybox
services:
db: # docker compose exec db mysql -u root -pasdf -e "create database if not exists laravel;"
@eduardoarandah
eduardoarandah / minimal_init.lua
Created January 21, 2022 19:55
minimal lsp config for github issue
local on_windows = vim.loop.os_uname().version:match 'Windows'
local function join_paths(...)
local path_sep = on_windows and '\\' or '/'
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd [[set runtimepath=$VIMRUNTIME]]
@eduardoarandah
eduardoarandah / .vimrc
Created January 12, 2022 19:56
My .vimrc configuration
" I split my config into separate files so my real ~/.vimrc is just:
" source ~/scripts/.vimrc
" source ~/scripts/.vimrcplugins
" Update everthing:
" PlugUpgrade
" PlugUpdate
" CocUpdate
scriptencoding utf-8 " basic
set nocompatible " basic
@eduardoarandah
eduardoarandah / UploadController.php
Last active November 3, 2023 17:11
File upload with dropzone and alpine js
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use Storage;
class UploadController extends Controller
@eduardoarandah
eduardoarandah / tailwind
Created March 18, 2021 04:11
All tailwind.css classes
-bottom-0
-bottom-1
-bottom-10
-bottom-11
-bottom-12
-bottom-14
-bottom-16
-bottom-2
-bottom-20
-bottom-24
@eduardoarandah
eduardoarandah / Login.vue
Last active March 11, 2021 02:32
Laravel Sanctum with jwt tokens in backend and vue in frontend without sessions or cors problems
<template>
<div class="">
<input v-model="user" type="text" />
<input v-model="pass" type="password" />
<button @click="login">Login</button>
<div class="">test: <button @click="test">test</button></div>
<div class="">user: <button @click="whoami">whoami</button></div>
<div class=""><button @click="logout">Logout</button></div>
<div class="">
@eduardoarandah
eduardoarandah / neovim-install.sh
Last active March 18, 2021 17:52
Neovim nightly Install script
# where's installed current version?
which nvim
# what's current version?
nvim -v
# make tmp folder
mkdir -p ~/tmp
cd ~/tmp
@eduardoarandah
eduardoarandah / script
Created January 7, 2021 19:40
Neovim build script
# Example build script
git clone https://github.com/neovim/neovim.git
cd neovim
make install
mv build/bin/nvim /usr/local/bin/nvim05
# put this in your .zshrc or .bashrc
alias v=/usr/local/bin/nvim05
alias nvim=/usr/local/bin/nvim05