Skip to content

Instantly share code, notes, and snippets.

@noahmayr
noahmayr / fzf-jj.sh
Last active November 26, 2025 02:07 — forked from chooglen/fzf-jj.zsh
Interactive `jj` with `fzf`
#!/bin/sh
### CONFIG ###
changeIdColumn="2"
commitIdColumn="3"
nodeTypes="@○◆•"
delimiterPattern='((?:^[^ ] +)|[^[:alnum:]:.])+'
defaultLogArgs=""
copyStdinToClipboard="pbcopy"
### END CONFIG ###
# need to export this so all subshells created by fzf are also going to use sh and the correct PATH env var
@donbrae
donbrae / similarText.js
Last active February 17, 2025 01:52
JavaScript function which mimics PHP’s `similar_text()`.
// Source: ChatGPT 4
function similarText(first, second) {
// Check for null, undefined, or empty string inputs
if (first === null || second === null || typeof first === 'undefined' || typeof second === 'undefined' || first.trim().length === 0 || second.trim().length === 0) {
return { matchingCharacters: 0, similarityPercentage: 0 };
}
// Type coercion to ensure inputs are treated as strings
first += '';
second += '';
@jonathandey
jonathandey / Laravel lnav ATTRIBUTION
Last active October 3, 2023 08:40
lnav formatter for Laravel logs
Regex from: https://github.com/haruncpi/laravel-log-reader
JSON based on: https://gist.github.com/fquinto/e137ce236297804a55a1e4d783373316
lnav: https://github.com/tstack/lnav
Installing a new lnav format: https://docs.lnav.org/en/latest/formats.html#installing-formats
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
#!/bin/bash
export TERM=xterm-256color
function tinkerwatch(){
clear;
tail -n $(expr $(wc -l $1 | awk '{ print $1 }') - 1) $1 | php artisan tinker
}
tinkerwatch $1
@dfontana
dfontana / CmderZSH.md
Last active December 22, 2025 14:58
My setup guide for installing Cgywin, Mintty, Cmder, and ZSH.

What's this?

Instructions to obtain ZSH on a windows environment, without the input funny business presented by some other attempted solutions.

The final result is ZSH running on a mintty terminal, emulated by cygwin, and being handled by the popular cmder.

Why is this here?

For the benefit of myself and others. I've already followed these instructions twice. It took me hours to figure all this out, maybe someone else can save a few.

What exactly is covered?

  • Installing and setting up cmder
sed -i 's/\r$//' script.sh # Prevent any newline script breaking silliness
@adamwathan
adamwathan / troubleshooting.md
Last active June 12, 2025 07:13
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@pylover
pylover / a2dp.py
Last active December 19, 2025 14:41
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator