Skip to content

Instantly share code, notes, and snippets.

@fl3pp
fl3pp / floating-help.lua
Created January 30, 2023 14:15
Floating help window for Neovim
function FloatingHelp(subject)
local stats = vim.api.nvim_list_uis()[1]
local width = math.ceil(stats.width * 0.8);
local height = math.ceil(stats.height * 0.8);
local buf = vim.api.nvim_create_buf(false, true)
local winConfig = {
relative = 'editor',
width = width,
height = height,
@fl3pp
fl3pp / vim_arrows.ahk
Created March 30, 2022 15:40
System-wide vim mapping for arrow keys using Alt modifier
#NoEnv
#InstallKeybdHook
#UseHook On
SendMode Input
SimulateKeyDown(key, modifier, direction)
{
Send %modifier%{ %direction% }
KeyWait, %key%, T.3
If (!ErrorLevel) {
@fl3pp
fl3pp / EqualityPerformanceTest.cs
Last active July 24, 2019 07:32
EqualityComparer vs Operators Benchmark
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Collections.Generic;
namespace EqualityPerformanceTest
{
public class Person
{
public int Id { get; set; } = 1;
@fl3pp
fl3pp / PicoCaching.php
Created December 10, 2018 15:29
Adds basic caching functionality to Pico
<?php
/*
Creates a 'cache.php' file in the content directory, containing all pages.
The file is being kept for a day, page changes will be ignored as long the cache file exists.
You can simply delete the cache file in order to refresh the pages and contents
*/
class PicoCaching extends AbstractPicoPlugin {
@fl3pp
fl3pp / PicoAnchors.php
Created November 27, 2018 08:50
Pico Anchors
<?php
# Create file 'PicoAnchors.php' in pico plugin folder and paste content
class PicoAnchors extends AbstractPicoPlugin {
public function onContentParsed(&$content) {
while ($this->getNextLink($content, $match)) {
$linkName = $match['name'][0];
$endingTagOffset = $match['endingtag'][1] + $this->lastOffset;
@fl3pp
fl3pp / PicoBom.php
Last active November 27, 2018 08:52
Plugin to support BOMs in Pico
<?php
# Create file 'PicoBom.php' in pico plugin folder and paste contents
class PicoBom extends AbstractPicoPlugin {
public function onContentLoaded(&$content) {
if (substr($content, 0, 3) == "\xEF\xBB\xBF")
$content = str_replace("\xEF\xBB\xBF",'',$content);
}