Skip to content

Instantly share code, notes, and snippets.

@lifepillar
lifepillar / reactive-framework.vim
Created December 29, 2023 17:33
Building a Reactive Library from Scratch in Vim 9 Script
vim9script
# Translation into Vim 9 script of the tutorial at:
# https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p
# Helper functions and classes {{{
def IndexOf(items: list<any>, item: any): number
return indexof(items, (_, e) => e is item)
enddef
@lifepillar
lifepillar / gruvbox8.vim
Created June 21, 2019 20:11
Save this into `~/.vim/autoload/airline/themes/gruvbox8.vim`
" -----------------------------------------------------------------------------
" File: gruvbox8.vim
" Description: Retro groove color scheme for Airline
" Author: morhetz <morhetz@gmail.com> (modified by Lifepillar for Gruvbox 8)
" Source: https://github.com/morhetz/gruvbox8
" Last Modified: 21 Jun 2019
" -----------------------------------------------------------------------------
let g:airline#themes#gruvbox8#palette = {}
color author color14 default
color cursor color7 color4 bold
color date default default
color line-number color14 color7
color title-blur color10 color14
color title-focus color15 color12 bold
color diff-header color4 default bold
color diff-chunk color3 default bold
color diff-del color9 default
color search-result color15 color3 bold
@lifepillar
lifepillar / 24-bit-color.sh
Created November 20, 2017 11:48
Test 24 bit colors in terminals
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
@lifepillar
lifepillar / gist:b5018945561e024eeb9fc57650fc5d61
Created October 23, 2017 15:31
Minimal unit-testing framework for Vim scripts (Stripped-down version of Vim testing functions)
fun! Test_this_should_be_fine()
call assert_equal(2, 1 + 1)
endf
fun! Test_this_should_fail()
call assert_equal(3, 1 + 1)
endf
" -----------------------------------------------------------------------------
" DO NOT MODIFY BELOW THIS LINE
@lifepillar
lifepillar / gist:940b846724071cb531fd2d0fe3b52bb9
Last active May 29, 2017 13:59
osync dev (3174981b9aea6e5fe614a3a497f0176151517d5c) going into a loop with Homebrew's pgrep (log file)
TIME: 0 - Script begin, logging to [/Users/me/osync.quicksync_task.log].
TIME: 0 - Local OS: [Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 ( )].
TIME: 0 - Entering function [InitLocalOSDependingSettings].
TIME: 0 - Entering function [PreInit].
TIME: 0 - Entering function [Init].
TIME: 0 - Entering function [RsyncPatterns].
TIME: 0 - Entering function [CheckEnvironment].
TIME: 0 - Entering function [PostInit].
TIME: 0 - Entering function [CheckCurrentConfigAll].
TIME: 0 - -------------------------------------------------------------
@lifepillar
lifepillar / gist:5540d93b197308b0b8820ce746b1415a
Created March 23, 2017 07:46
Homebrew Cask formula for MacVim (up to date as of snapshot-129)
cask 'macvim' do
version '8.0.129'
sha256 'a75d4999986f65b12b5adecde9dbdcf30ae04a19545a65b0131783c547897cf2'
url "https://github.com/macvim-dev/macvim/releases/download/snapshot-#{version.patch}/MacVim.dmg"
appcast 'https://github.com/macvim-dev/macvim/releases.atom',
checkpoint: 'b94f207852bed3a9ece4d15be8163ed9a9b6abd18a751e0ae02123f42bb8b8c2'
name 'MacVim'
homepage 'https://github.com/macvim-dev/macvim'
@lifepillar
lifepillar / 256-colors.pl
Created February 24, 2017 05:42
Display ANSI colors and 256-color palette in terminals
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@lifepillar
lifepillar / gist:326343a0fd0075a738641e76aef0fe0e
Created October 30, 2016 09:16
OpenEmulator crashing when trying to open the Apple II plus template.
Process: OpenEmulator [65181]
Path: /Applications/OpenEmulator.app/Contents/MacOS/OpenEmulator
Identifier: org.openemulator.OpenEmulator
Version: 1.0.3 (793)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: OpenEmulator [65181]
User ID: 501
Date/Time: 2016-10-30 10:11:15.858 +0100
Process: vim [719]
Path: /usr/local/Cellar/vim/8.0.0046/bin/vim
Identifier: vim
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [656]
Responsible: vim [719]
User ID: 501
Date/Time: 2016-10-26 21:22:10.483 +0200