Skip to content

Instantly share code, notes, and snippets.

View colstrom's full-sized avatar

Chris Olstrom colstrom

View GitHub Profile
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 19:58
sanitize-git-remote-url.fish: removes clutter from URLs
name = sanitize-git-remote-url
author = Chris Olstrom
license = MIT
provides = fish/functions/sanitize-git-remote-url
requires
fish/builtin/end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:46
show-source.fish: pretty-prints function definitions
name = show-source
author = Chris Olstrom
license = MIT
provides = fish/functions/show-source
requires
command/fish_indent
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 20:30
list.fish: coerces arguments into lists
name = list
author = Chris Olstrom
license = MIT
provides = fish/functions/list
requires
fish/builtin/case
@colstrom
colstrom / exists.fish
Last active December 9, 2016 06:48
exists.fish: sugar for test with string/bool output
function exists -a target
test -e "$target"
status-to-bool $status
end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:56
is-a-directory.fish: sugar for test with string/bool output
name = is-a-directory
author = Chris Olstrom
license = MIT
provides = fish/functions/is-a-directory
requires
fish/builtin/end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:40
is-a-file: sugar for test with string/bool output
name = is-a-file
author = Chris Olstrom
license = MIT
provides = fish/functions/is-a-file
requires
fish/builtin/end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:40
string-to-bool.fish: coerces strings into fixed true/false values
name = string-to-bool
author = Chris Olstrom
license = MIT
provides = fish/functions/string-to-bool
requires
fish/builtin/case
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:57
status-to-bool.fish: converts exit statuses into boolean values
name = status-to-bool
author = Chris Olstrom
license = MIT
provides = fish/functions/status-to-bool
requires
fish/builtin/and
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:44
unset.fish: compatibility shim for bash unset
name = unset
author = Chris Olstrom
license = MIT
provides = fish/functions/unset
requires
fish/builtin/end
@colstrom
colstrom / empty.fish
Last active December 9, 2016 06:43
empty.fish: sugar for test with less surprising results
function empty
switch (count $argv)
case 0
true
case '*'
for string in $argv
test -z "$string"
and return (true)
end
end