Skip to content

Instantly share code, notes, and snippets.

@tomlea
Created February 27, 2009 12:20
Show Gist options
  • Select an option

  • Save tomlea/71438 to your computer and use it in GitHub Desktop.

Select an option

Save tomlea/71438 to your computer and use it in GitHub Desktop.
Prevent textmate exploding when you do a "mate /" by accident.
function mateforce(){
`which mate` $*
}
function mate(){
if find $* -type f | ~/line_count_less_than 1000
then
mateforce $*
else
echo "Too many files!"
echo "If you are sure you wish to do this, then please use mateforce"
false
fi
}
#!/usr/bin/env ruby
max_count = ARGV.first.to_i
count = 0
while STDIN.gets
count += 1
exit 1 if count > max_count
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment