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
Created December 9, 2016 20:14
with-cwd-as.fish: executes commands in another directory
name = with-cwd-as
author = Chris Olstrom
license = MIT
provides = fish/functions/with-cwd-as
requires
fish/builtin/and
@colstrom
colstrom / gistpkg-manifest.fish
Created December 9, 2016 20:19
gistpkg-manifest.fish: generate gistpkg.zpl from a .fish function
function gistpkg-manifest --argument file
switch (count $argv)
case 0
echo 'usage: gistpkg-manifest <file>'
return 100
case '*'
set name (basename -s .fish $file)
printf "name = %s\n\n" $name
@colstrom
colstrom / gistpkg.zpl
Created December 9, 2016 20:22
tab.fish: sugar for printing literal tabs
name = tab
author = Chris Olstrom
license = MIT
provides = fish/functions/tab
requires
fish/builtin/end
@colstrom
colstrom / directory-in-git.fish
Created December 9, 2016 20:36
directory-in-git.fish: check if a directory is or is in a git repository
function directory-in-git --argument dir
git -C "$dir" rev-parse --is-inside-working-tree >/dev/null ^/dev/null
status-to-bool $status
end
#!/usr/bin/env ruby
require 'set'
data = Dir
.glob('*')
.reject { |file| file.end_with? '.rb' }
.map { |os| [os, File.read(os)] }
.map do |os, info|
[
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /bin/sh
# -*- shell-script -*-
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Copyright (c) 2017 SUSE LLC
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@colstrom
colstrom / z85
Created September 27, 2017 00:24
#! /usr/bin/env ruby
# The MIT License (MIT)
# Copyright (c) 2017 Chris Olstrom <[email protected]>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is