Skip to content

Instantly share code, notes, and snippets.

@sbrow
sbrow / index.pegjs
Last active February 14, 2025 21:55
Simple lisp parser in Javascript
// Simple Lisp Parser
// ==========================
//
// Accepts expressions like "(* 2 (+ 3 4))" and computes their value.
{
// This initializer block allows us to define a variables object
//const variables = options;
const variables = {
users: 2,
@sbrow
sbrow / lazyvim-plugin.md
Created December 29, 2023 18:06
Nushell + Lazyvim <3

Setting up nushell with LazyVim

Add this file as a custom plugin:

-- ./lua/plugins/nu-lsp.lua

vim.filetype.add({
    extension = {
        nu = "nu",
@sbrow
sbrow / phpquery.php
Created November 24, 2019 21:01
PHP Onefile (Library and CLI). Derived from https://code.google.com/archive/p/phpquery/
<?php
if ( realpath( $argv[0] ) == realpath( __FILE__ ) ) {
if ( ! isset( $argv[1] ) || $argv[1] == 'help' || $argv[1] == '--help' || $argv[1] == '-h' ) {
die( "Usage:
phpquery URL --method1 arg1 arg2 argN --method2 arg1 arg2 argN ...
Example:
phpquery 'http://localhost' --find 'div > p' --contents
Pipe:
cat index.html | phpquery --find 'div > p' --contents
Docs:
@sbrow
sbrow / .gitignore
Last active June 23, 2019 23:57
React Component Tests
node_modules
@sbrow
sbrow / .gitignore
Last active May 20, 2019 20:46
rsync-backup
node_modules
config.json
@sbrow
sbrow / bjstat
Last active March 3, 2019 06:53
Crawler script for BuJo
#!/bin/bash
source $(dirname "${BASH_SOURCE[0]}")/crawler
if [[ -n $1 ]]; then
GLOB=("$@")
fi
SED='sed'
if [[ "$(uname)" == "Darwin" ]]; then
SED='gsed';