Baylor Rae' BaylorRae

View functions.php
1 2 3 4 5 6 7 8 9 10
<?php
 
// http://michelf.ca/projects/php-markdown/
require_once 'markdown.php';
 
/**
* parses markdown before printing on the page
*
* you could put this in MarkdownCommentParser::comment
* if you wanted to save off the html
View markup.html
1 2 3 4
<label>
<input type="checkbox">
Is this awesome?
</label>
View install.sh
1 2 3 4 5 6 7 8 9 10
mkdir /app
 
 
# Compiling Apache
 
curl http://www.us.apache.org/dist/httpd/httpd-2.2.22.tar.gz | tar xzf -
 
cd httpd-2.2.22
./configure --prefix=/app/apache --with-z=/usr/local/zlib --enable-rewrite --enable-so --enable-deflate --enable-expires --enable-headers
make && make install
View complex-line-result.php
1 2 3 4 5 6
array(
'url' => '...',
'title' => '...',
'author' => '...',
'id' => 123 // the new item
)
View _form.php
1 2 3 4 5 6 7 8 9 10
<form method="POST">
 
<div class="field">
<label for="url">URL:</label>
<input type="text" for="url" name="website[url]" value="<?php echo $website->url ?>" />
</div>
 
<div class="field">
<label for="title">Title:</label>
<input type="text" for="title" name="website[title]" value="<?php echo $website->title ?>" />
View deploy.rb
1 2 3 4 5 6 7 8 9
set :user, "USERNAME"
 
# about the application
set :application, "example.com"
set :port, 2222
 
# the type and location of the repository
set :scm, :git
set :repository, "."
View models.rb
1 2 3 4 5 6 7 8 9 10
# product.rb
class Product < ActiveRecord::Base
has_many :categorizations
has_many :categories, :through => :categorizations
end
 
# category.rb
class Category < ActiveRecord::Base
has_many :categorizations
has_many :products, :through => :categorizations
View functions.php
1 2 3 4 5 6 7 8 9
<?php
function markdown_filter($data, $post) {
 
// change this to match your heroku app url
$ch = curl_init('http://radiant-stone-4578.heroku.com/parse');
 
curl_setopt_array($ch, array(
// don't print the result when done
CURLOPT_RETURNTRANSFER => true,
View markup.html
1 2 3 4
<label>
<input type="checkbox">
Is this awesome?
</label>
View huck_autoloader.php
1 2 3 4 5 6 7 8 9 10
<?php
 
// Allows multiple __autoload stacks
// and keeps autoloader in Huck class
spl_autoload_register(array('Huck', 'autoload'));
 
class Huck {
 
public static function autoload($class_name) {
if( substr($class_name, 0, 5) === 'Huck_' ) {
Something went wrong with that request. Please try again.