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
'from http://stackoverflow.com/a/192184/1663589 | |
def dump(obj): | |
for attr in dir(obj): | |
print "obj.%s = %s" % (attr, getattr(obj, attr)) |
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
# add requires as needed... | |
# main app | |
class App < Sinatra::Base | |
register Sinatra::Namespace | |
# mount routes from extension | |
register Sinatra::Guides | |
mount_guides |
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
find . -type f -print0 | xargs -0 perl -pi -e 's/\r\n/\n/' |
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
git status -sb | awk '{ print $2 }' | sed -e '1d' | xargs perl -le 'for (@ARGV) { print unless -f && -T }' |
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
git status -sb | awk '{ print $2 }' | sed -e '1d' | xargs perl -le 'for (@ARGV) { print if -f && -T }' |
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
git ls-files | xargs perl -le 'for (@ARGV) { print if -f && -T }' | xargs perl -pi -e 's/\r\n/\n/' |
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/sh | |
# Amend the commit message one specific commit and rebase | |
# to apply the changes. Given the SHA hash or a reference | |
# of the commit to amend, it checkouts the commit, amends | |
# it interactively and rebases the repo history in master. | |
# | |
# This action is destructive to your repo's history and this | |
# should not be performed on a repo that has been shared with | |
# others, because it will force them to reset their history. | |
# |
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/sh | |
# Apply messages from provided input file to commits with empty messages | |
# The messages are applied in inverse order (first line in the file applied to older commit with void message) | |
# and only up to the number of commits with empty messages. | |
# | |
# This action is destructive to your repo's history. It's best to do this on a clone, | |
# just in case. Also beware that this should not be performed on a repo that has been | |
# shared with others without forcing them to reset their history. | |
# | |
# Use at your own risk. |
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/sh | |
# Reset the commit dates to their corresponding author dates, in the current | |
# branch. Usually useful to preserve the original timestamps after a rebase. | |
# | |
# This action is destructive to your repo's history and this should not | |
# be performed on a repo that has been shared with others, because it | |
# will force them to reset their history. | |
# | |
# Use at your own risk. | |
# |
OlderNewer