This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/rc | |
# Runs a command in an acme window, as with button 2 | |
# Tries to restore original selection. | |
rfork e | |
if(! ~ $#* 1 2) | |
exit 'usage: exe PARAM [WINID]' | |
cmd=$1 | |
id=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/rc | |
# A variant of the Look command of acme. | |
# Usage: Looki [-r] [-s] [-w] [-x] [SEARCH] | |
# -r: search backwards | |
# -s: case sensitive | |
# -w: whole words | |
# -x: regex mode, only makes sense when giving explicit param | |
# Flags may be combined, as in: -rws | |
# | |
# This is not an acme builtin: if invoked with an explicit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/rc | |
# An rc approximation of rsc's https://pkg.go.dev/9fans.net/go/acme/Watch | |
# | |
# Usage: Watch [-r | -n] [-d DIR] [CMD] | |
# -s starts command immediately | |
# -r listen for Put on subdirs recursively. | |
# -n only run the commands when Get is run | |
# -d cd to given dir, and listen for Put on files under it | |
# Flags taking no param may be combined eg: -sr | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To setup a new machine: | |
# - run $0 text on an existing machine | |
# - copy the output into the terminal of the target machine | |
set -euo pipefail | |
text() { | |
local string="$(tar cfj - \ | |
bin/setup-string \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Encrypts ~/.secrets into ~/.secrets.gpg and back | |
set -eo pipefail | |
source _functions | |
SECRETS=$HOME/.secrets | |
ARCHIVE=$HOME/.secrets.gpg | |
STATE=$SECRETS/gpg-checksum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
; Explanation for the `mini-stats` command in this script: | |
; - I customised my shell prompt to show the output of `git.clj mini-stats .` | |
; | |
; - Then I get in my prompt information like: | |
; `main` - if the current branch is main and there are no unpushed changes, in any branch. | |
; | |
; Or something more complicated like: | |
; `main 2/4/hack(2),bugfix(5)` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e -o pipefail | |
my-dirs() { | |
mkdir -p ~/{src,tmp} | |
if [[ $(hostname) = penguin ]]; then | |
[[ -r ~/downloads ]] \ | |
|| ln -sfv /mnt/chromeos/MyFiles/Downloads ~/downloads | |
else | |
mkdir -p ~/downloads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
## TODO | |
# - use ~/bin/laptop for more things | |
PROG = 'status-bar' | |
NPROC = `nproc`.to_i | |
if true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;; db.cljd | |
(ns mu.db | |
(:require | |
[mu.utils :as u])) | |
(defprotocol Db | |
(init- [db opts] "***") | |
(show- [db] "dumps tables contents") | |
(save-blobby- [this bytes] "save Uint8List to blobbies table") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample.navigation | |
"Port of https://docs.flutter.dev/cookbook/navigation/navigation-basics" | |
(:require | |
["package:flutter/material.dart" :as m] | |
[cljd.flutter.alpha :as f])) | |
(def second-route | |
(f/widget | |
:inherit [m/Navigator] | |
(m/Scaffold |
NewerOlder