This file contains 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
" My first super-simple and hardcoded bit of VimScript | |
" that opens up a markdown-based journal file | |
function! JournalToday() | |
let filename = strftime("~/journal/%Y-%m-%d.markdown") | |
echo "Opened journal: " . filename | |
execute "vsplit" filename | |
endfunction | |
" executing a function is literal: enter command-line mode, enter call and the | |
" function name, and press return |
This file contains 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 | |
# This script will regenerate every tag in a repository, setting the | |
# creation date of the tag to that of the commit that the tag is | |
# attached to. The message for the tag is set to the static string | |
# 'End of unit'. | |
git tag | while read tag; | |
do | |
git checkout ${tag} |
This file contains 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 | |
# This script applies tags that have become detached from a rebased branch, assuming | |
# that the original message for each tag has been unchanged in the rebased branch. | |
# This is necessary because tags get bound to a commit hash and a rebase will alter | |
# the commit hashes on a branch, "detaching" any tags that have been attached. It is | |
# of course debatable whether tags _should_ be moved around at all, but I needed to | |
# do this for a particular repo I have been working on. It has also been a good | |
# opportunity for me to explore git and some command line tools. It is not meant to | |
# be a reference script and there will almost certainly be much more effective ways |
This file contains 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 | |
echo "Starting $@" | |
nohup "./$@" &> /dev/null & |
This file contains 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
def create_lambda | |
lambda {|i| puts "You're at #{i}" } | |
end | |
my_lam = create_lambda | |
[1,2,3].each &my_lam |
This file contains 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
Gem.available?('gemname') |
This file contains 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
my_thing.instance_eval { (class << self; self; end).instance_eval "include MyModule" } |