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
<?php | |
class Controller_Blog extends Controller { | |
/** | |
* This is a simple example, the class does not exist. There are much more | |
* things you would be able to do, this is just an example. | |
* | |
* Yes, I know this is all (kind of) currently possible, but this encapsulates | |
* the response and allows for nice things like advanced response caching. |
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/env ruby | |
# USAGE: sudo ./init.rb project_name path/to/web/root | |
# NOTE: This file must be run with root privileges (sudo). | |
# You must also give it exec permissions: chmod +x init.rb | |
# This should include the trailing slash | |
DEFAULT_ROOT = '/Users/dan/Sites/' | |
VHOST_FOLDER = '/etc/apache2/sites/' |
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/env ruby | |
# Pow Port | |
# | |
# Quickly and easily change the port that Pow is running on. This allows | |
# you too run Apache and Pow side-by-side (on different ports of course). | |
# | |
# WARNING: This will OVERWRITE your ~/.powconfig file. If you have custom | |
# configurations in there, please back it up first. | |
# |
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/env ruby | |
# Pow Port | |
# | |
# Quickly and easily change the port that Pow is running on. This allows | |
# you too run Apache and Pow side-by-side (on different ports of course). | |
# | |
# WARNING: This will OVERWRITE your ~/.powconfig file. If you have custom | |
# configurations in there, please back it up first. | |
# |
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
# Time based file caching | |
# | |
# This allows you too set a lifetime on File Based caches | |
# This is a modified version of a class I found here: | |
# http://blog.ubrio.us/ruby/ruby-rails/simple-rails-time-based-fragment-caching-with-file-store/ | |
# | |
# - Save this file somewhere (e.g. lib/timed_file_store.rb) | |
# - Include it (e.g. in config/application.rb) | |
# | |
# Example Usage: |
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
# You need to set the Article.path to where your files are located. | |
# I do this in my application_controller.rb | |
Article.path = File.join(Rails.root, 'articles') | |
class Article | |
attr_reader :title, :tags, :mtime, :slug, :filename | |
def self.path=(path) | |
@@path = path | |
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
class String | |
def to_human_title | |
self.gsub(/[-_]/, " ").split(' ').map {|w| w.capitalize }.join(' ') | |
end | |
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
################################################ | |
## GENERAL SETTINGS | |
################################################ | |
shared_writable_dirs: [/fuel/app/cache, /fuel/app/logs] | |
local_writable_dirs: [/fuel/app/tmp] | |
################################################ | |
## WEB SPECIFIC SETTINGS | |
################################################ | |
document_root: /public |
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
[user] | |
name = Your Name | |
email = [email protected] | |
[core] | |
autocrlf = input | |
[color] | |
status = auto | |
diff = auto | |
branch = auto | |
[alias] |
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
<?php | |
/** | |
* TestClass | |
* | |
* This is just a test class for the Annotated\ReflectionClass | |
* to use. | |
* | |
* Foo::bar(); | |
* |