Skip to content

Instantly share code, notes, and snippets.

View danielbayley's full-sized avatar
👨‍💻
Working on too many things…

Daniel Bayley danielbayley

👨‍💻
Working on too many things…
View GitHub Profile
@danielbayley
danielbayley / stdin.zsh
Last active May 16, 2020 00:30
Make any command accept stdin.
#! /bin/zsh --no-rcs --err-exit
pushd = cd () { builtin $0 "${@:-`<&0`}"}
pwd # $HOME
print ~/Desktop | cd
pwd # ~/Desktop
cd -
pwd # $HOME
pwd # $HOME
@danielbayley
danielbayley / pnpm.command
Last active August 4, 2023 18:19
A shim to seamlessly alias @npm to @pnpm.
#! /bin/zsh --no-rcs --err-exit
export PATH=node_modules/.bin:$PATH
alias -g i=install
if (($+commands[pnpm])) then
local p=p
alias pnpm=npm npx=pnpx
# FIXME https://github.com/pnpm/pnpm/issues/1360
npm config get -g global-dir | read
@danielbayley
danielbayley / git.zsh
Last active May 16, 2020 00:29
A useful shim for @git.
#! /bin/zsh --no-rcs --err-exit
# Git/Hub
# TODO $DOTFILES/git/clone.zsh #danielbayley/binstubs #/git
# https://github.com/xreader/git-for-humans
alias clone='git clone'
alias github=hub
#alias git-date='git commit date'
@danielbayley
danielbayley / gitkraken.command
Last active July 6, 2019 04:27
A CLI for GitKraken
#! /bin/zsh -f
argv=${1:-$PWD}/
if ([ ! -d $1.git ]) return
pkill -9 GitKraken
open -a $_ --args --path $1
@danielbayley
danielbayley / anka.command
Last active May 16, 2020 00:27
A shim for anka[-flow] by @veertuinc.
#! /bin/zsh -f
alias vm=anka
if (which -s anka) vm () {
set -- ${${@/ls/list}/-h*/--help}
case $@ in
view*) command anka start ${@:2} && command anka $@;;
l*s*img*) command anka "list${=*/*img/-images}";;
reg*) command anka registry ${@:2};;
*) command anka $@;;
esac
@danielbayley
danielbayley / gem.zsh
Last active May 16, 2020 00:25
A shim for @rubygems to make gem install behave more like @npm.
#! /bin/zsh -f
#alias -g i=install
#RUBY_VERSION=`ruby -e 'print RUBY_VERSION'`
#export PATH=$PATH:ruby/$RUBY_VERSION/bin:$GEM_HOME/bin
gem () {
case $@ in
install*-g*) command gem install ${@:3};;
install*) command gem install ${@:2} --install-dir=ruby/$RUBY_VERSION;;
rm*) command gem uninstall $@;;
@danielbayley
danielbayley / basic.css
Last active November 6, 2022 19:50
Reset CSS
html:focus-within { scroll-behavior: smooth }
footer {
position: sticky;
top: 100vh
}
format_version: 4
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
#project_type: macos
trigger_map:
- push_branch: '*'
workflow: test
- pull_request_target_branch: '*'
workflow: test
@danielbayley
danielbayley / starcraft-mass-recall.rb
Last active May 12, 2025 11:53
@Homebrew formula for StarCraft: Mass Recall
cask "starcraft-mass-recall" do
version "8.0.1"
sha256 "76750def5b63cf58afeb63e9948b5efec23adb436964eb730fe5d800d5a89e3b"
resources = {
mod: ["3246208", "SCMR_v#{version}.zip"],
assets: ["3239552", "SCMRassets_v#{version}.zip", "9277d51c89e3cc473a3b5d588c2f3cdb"],
cinematics: ["2819339", "SCMRcinematics_v7.2.zip", "f19ea12979eb8eaf703ed00ef33b7912"],
redux: ["3246278", "Enslavers_Redux_v#{version}.zip", "b61129ef7df2004faa4c08480e447f31"],
}
// Crypto Expansion Pack - Numi.io
numi.addUnit({
"id": "wei",
"phrases": "wei, Wei",
"baseUnitId": "ETH",
"format": "Wei",
"ratio": 1e-18,
});