Skip to content

Instantly share code, notes, and snippets.

View metalelf0's full-sized avatar

Andrea Schiavini metalelf0

View GitHub Profile
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Incident Identifier: D7E7C781-C3D7-4D6F-B78B-D552229568CF
CrashReporter Key: DBCCF9F5-7A0F-5297-7130-1495532A3A68
Hardware Model: MacBookPro17,1
Process: VimR [21417]
Path: /Applications/VimR.app/Contents/MacOS/VimR
Identifier: com.qvacua.VimR
@metalelf0
metalelf0 / telescope-hashtags-picker.lua
Created February 12, 2023 11:28
Neovim telescope hashtag picker
local M = {}
M.pick_hashtags = function(opts)
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
opts = opts or {}
@metalelf0
metalelf0 / eat-food.zsh
Last active February 28, 2024 07:44
Sample zsh script with both interactive user menu and direct input
#!/usr/bin/env zsh
# Call this script with:
# ./eat-food.zsh [opt]
#
# If a food is given, and is in the valid foods (opts array), it will eat the given food
# e.g. ./eat-food.zsh bananas
#
# If a food is given, but it's not valid, it will prompt for a food to eat
# e.g. ./eat-food.zsh pineapples
@metalelf0
metalelf0 / config.lua
Created April 23, 2021 12:54
Example configuration using paq-nvim.lua
-- init.lua
local cmd = vim.cmd
local fn = vim.fn
local g = vim.g
require 'plugins'
-- plugins/init.lua
local cmd = vim.cmd
local fn = vim.fn
local g = vim.g
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine!
function! CreateCenteredFloatingWindow(title) abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
let top = "╭" . repeat("─", width - 2) . "╮"
@metalelf0
metalelf0 / italian_names.md
Created February 25, 2019 13:53
Italian names by gender

Male names

Abaco Abbondanzio Abbondio Abdone Abelardo Abele Abenzio Abibo Abramio

@metalelf0
metalelf0 / rails_model_template.rb
Created November 14, 2018 13:49
A rails model template to better organize your code
# provided by https://www.zmwolski.com/Organizing-Ruby-on-Rails-Models
class User < ActiveRecord::Base
# == Constants ============================================================
# == Attributes ===========================================================
# == Extensions ===========================================================
@metalelf0
metalelf0 / check-updates.sh
Created May 14, 2018 07:25
Recursively check subdirectories to see git repos with pending changes
#!/bin/zsh
tempfile=output
touch $tempfile
check_update () {
cd $1
if [[ -d .git ]]
then
git fetch -q origin
commits_count=`git log master..origin/master --oneline | wc -l`
❯ sudo aptitude install libfreetype6-dev
The following NEW packages will be installed:
libfreetype6-dev libpng12-dev{a}
0 packages upgraded, 2 newly installed, 0 to remove and 22 not upgraded.
Need to get 0 B/2.833 kB of archives. After unpacking 6.782 kB will be used.
The following packages have unmet dependencies:
libpng16-devtools : Conflicts: libpng12-0-dev which is a virtual package, provided by:
- libpng12-dev, but 1.2.54-1ubuntu1 is to be installed.
Conflicts: libpng12-dev but 1.2.54-1ubuntu1 is to be installed.
Conflicts: libpng3-dev which is a virtual package, provided by:
@metalelf0
metalelf0 / neovim_colorscheme_patcher.rb
Created September 3, 2015 12:27
Neovim colorscheme patcher to add 24bit colors to terminal
#!/usr/bin/env ruby
class VimColorscheme
attr_accessor :file_path
def initialize(file_path)
@file_path = file_path
end
def extract_colors