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
#!/usr/bin/ruby | |
Dir['**/'].each do |dir| | |
puts "Placing .keep file in #{dir}" | |
`touch #{dir}.keep` | |
end |
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
# Recursively add a .gitignore file to all directories | |
# in the working directory which are empty and don't | |
# start with a dot. Helpful for tracking empty dirs | |
# in a git repository. | |
for i in $(find . -type d -regex ``./[^.].*''); do touch $i"/.gitignore"; done; |
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
WITH RECURSIVE page_list AS ( | |
SELECT root.id, root.title, root.parent_id, root.published_at, | |
1 AS page_level, | |
root.id AS root_id, | |
root.title AS root_title | |
FROM pages AS root | |
WHERE root.parent_id IS NULL | |
UNION ALL |
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
# Adapted the script listed in the following link to maintain git history | |
# Original Script: http://snippets.dzone.com/posts/show/5449 | |
# Usage: | |
# 1) Copy the file to the root of your Rails app | |
# 2) Run the script (i.e., ruby to_haml.rb app/views) | |
class ToHaml | |
def initialize(path) | |
@path = path | |
end |