Skip to content

Instantly share code, notes, and snippets.

View brainplot's full-sized avatar
🏠
Working from home

Gianluca Recchia brainplot

🏠
Working from home
View GitHub Profile
@brainplot
brainplot / requirements.txt
Created August 6, 2021 07:35
Small script to clean up my uBlock origin rules
tld==0.12.6
@brainplot
brainplot / configuration-Office365-x64.xml
Last active July 12, 2021 06:52
Configuration file to use with Office Deployment Tool that excludes some Office applications I don't use.
<Configuration>
<Add OfficeClientEdition="64" Channel="Monthly">
<Product ID="O365ProPlusRetail">
<Language ID="en-us" />
<Language ID="it-it" />
<ExcludeApp ID="Access" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
<ExcludeApp ID="Publisher" />
<ExcludeApp ID="Teams" />
@brainplot
brainplot / sensible.vim
Last active June 12, 2021 19:04
Sensible configuration for a clean vim installation that doesn't write tilde files all over the system.
set number
set relativenumber
set nobackup
set nowritebackup
set noswapfile
set noundofile
@brainplot
brainplot / update_neovim.sh
Created January 24, 2021 10:23
Fetch latest neovim nigthly for MacOS
#!/bin/sh
ARCHIVE=nvim-macos.tar.gz
ARCHIVE_ROOT=nvim-osx64
OUTPUT_DIR="$HOME/Documents/nvim"
UPSTREAM_URL='https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz'
curl -JOL "$UPSTREAM_URL" &&
tar -xf "$ARCHIVE" && \
rm -rf "$OUTPUT_DIR" && \
@brainplot
brainplot / settings.json
Last active June 26, 2023 17:30
Windows Terminal settings
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "moveFocus",
"direction": "down"
@brainplot
brainplot / rebuild_font_cache.bat
Last active September 12, 2023 11:39
Rebuild font cache in Windows and reboot your computer in order to solve some font rendering issues
:: This script should be run in a priviledged command prompt
@echo off
echo This script is going to restart your computer.
echo Make sure to close all open applications in order not to lose any unsaved work.
choice /m "Do you want to continue"
if %errorlevel% NEQ "1" goto End
@brainplot
brainplot / vim-logo.txt
Created April 29, 2020 05:56
.vimrc logo ASCII art
________ ++ _______
/VVVVVVVV\+++++ /VVVVVVV\
\VVVVVVVV/+++++++\VVVVVVV/
|VVVVVV|++++++++/VVVVV/'
|VVVVVV|++++++/VVVVV/'
+|VVVVVV|++++/VVVVV/'+
+++|VVVVVV|++/VVVVV/'+++++
+++++|VVVVVV|/VVVVV/'+++++++++
+++|VVVVVVVVVVV/'+++++++++
+|VVVVVVVVV/'+++++++++
@brainplot
brainplot / conditionally-byte-compile.el
Created March 4, 2020 19:48
Byte-compile emacs configuration upon startup, if it's changed
(let ((config-org (concat user-emacs-directory "main-config.org"))
(config-el (concat user-emacs-directory "main-config.el")))
(if (file-newer-than-file-p config-org config-el)
(progn
(message "TANGLING THE CONFIG")
(org-babel-load-file config-org)
(run-with-idle-timer 10 nil
(lambda ()
(byte-compile-file config-el)
(message "CONFIG BYTE COMPILED"))))
@brainplot
brainplot / password-store-fix-fish-completion.patch
Created February 29, 2020 19:38
Patch to fix Fish completions for password-store when the vault is empty
diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion
index 8637874..a974d7e 100644
--- a/src/completion/pass.fish-completion
+++ b/src/completion/pass.fish-completion
@@ -39,7 +39,8 @@ function __fish_pass_print
set -l ext $argv[1]
set -l strip $argv[2]
set -l prefix (__fish_pass_get_prefix)
- printf '%s\n' "$prefix"/**"$ext" | sed "s#$prefix/\(.*\)$strip#\1#"
+ set -l matches "$prefix"/**"$ext"
@brainplot
brainplot / dump_walk.php
Created November 25, 2019 06:51 — forked from jgusta/dump_walk.php
A function that returns a big string version of var_dump or print_r except it descends into private props and shows things in as compact manner as possible.
<?php
if (!function_exists('dump_walk')) {
/**
* This function is like print_r($node, true) but cleaner
* @param $node
* @param string $indent_string
* @param int $depth
* @param null $parentType
* @return string
*/