Posts tagged ‘recipe’

Funnel Cakes with Missy and Eddie

We decided to make some funnel cakes with a couple friends of ours. These turned out to be delicious, and not too long to prepare. If you have accommodations for more oil, it is probably less than 6-8 minutes per funnel cake.

Funnel Cke Picture

Yummy goodness

Recipe

Ingredients: 2 eggs, 1.5 cups milk, 2 cups sifted all purpose flour, 1 teaspoon baking powder, 1 teaspoon salt, 1 tablespoon sugar, 1 teaspoon vanilla extract, 1 cup of oil, powdered sugar and cinnamon

Preparation:

  1. Sift flour, baking powder, salt and sugar
  2. Beat eggs separately, add milk, vanilla and stir
  3. Add flour mixture to liquids and beat until smooth
  4. Heat oil to approximately 350 degrees
  5. Pour enough mixture into pan using a sweeping motion back and forth, then side to side
  6. 3 -5 minutes on each side
  7. Remove from heat, pat dry and sprinkle with powdered sugar, and cinnamon

Using CakePHP with Godaddy

I was able to setup CakePHP on godaddy, the most frustrating part I dealt with was the wild goose chase I was sent on by Google trying to figure it out.

  1. Add Options +FollowSymlinks to three .htaccess files
  2. Add RewriteBase /path/to/app to the /.htaccess file

I first set my site up to work on a sub-directory for practice as the site was already live. When I did this, I set RewriteBase /test (where my directory was test).

Here are the three .htaccess files:

  • base_directory/.htaccess (this was /test while I was setting it up, and / after I moved it later)
    <IfModule mod_rewrite.c>
    	 Options +FollowSymlinks
       RewriteEngine on
    	 RewriteBase /
       RewriteRule    ^$ app/webroot/    [L]
       RewriteRule    (.*) app/webroot/$1 [L]
    </IfModule>
    
  • webapp/.htaccess
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine on
        RewriteRule    ^$    webroot/    [L]
        RewriteRule    (.*) webroot/$1/    [L]
     </IfModule>
    
  • /app/webroot/.htaccess
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
    </IfModule>
    
  • For what it’s worth, I would just complete the first step and see if this suffices (the .htaccess in the application root). I had already changed the latter two files, and didn’t feel like going back and editing them, just in case it might have caused a new headache

After these few changes, it was a breeze really. I just wish I hadn’t been sent on the proverbial wild goose chase for this 2 lines of code that got this app working.

Show ActiveRecord SQL in Rails 3 Console

If you want to show sql in your console for Active Record, then you may have run across the past Rails Recipes book or similar formulas for Rails < v3.0.  I just tweaked a formula I saw in that book to work with Rails 3 and here it is (This is designed to work on a Mac or most Linux flavors, Windows users, YMMV):

Create ~/.irbrc or add the following to your .irbrc, Mine is located at ~/.irbrc

if defined?(Rails) && Rails.env
  load File.dirname(__FILE__) + "/.railsrc"
end

Create ~/.railsrc or add the following to your ~/.railsrc:

def toggle_sql
  if ActiveRecord::Base.logger
    set_logger nil and return false
  else
    set_logger Logger.new(STDOUT) and return true
  end
end

def set_logger(logger)
  ActiveRecord::Base.logger = logger
  ActiveRecord::Base.clear_active_connections!
end
set_logger nil # start with the normal logger

Then, when you’re in your rails console world, just call toggle_sql. It returns true if the sql will be on, and false if the sql will be off.

Please feel free to leave suggestions and improvements here as I am always open to these suggestions.

Displaying our New Widget Container on WordPress

Before you tackle this article, it is very important to check out this link: Add a Widget Container to Twenty Ten Theme.

After you have created a new widget container in the Twenty Ten theme (or whatever theme you are using), then you can continue here and this will enable your widget to display on every single page of your website.  Similar to the way that it does it on this blog.

Browse to Admin -> Appearance -> Editor and open header.php (on the right hand side of your admin page).

Now at this stage, I would suggest just getting comfortable with everything here, but our content is going to go just before the line seen below:

<div id="header">

Here is the code Snippet to paste in:

<?php if (!dynamic_sidebar("Header Top Widget") ) : ?>
Default header widget stuff here…
<?php endif; ?>

At this point, if you haven’t configured your widget from the previous post, then head over there now, or your blog will have the text “Default header widget stuff here…” displaying on every page of your application. Once more, you configure this widget by browsing to Admin -> Appearance -> Widgets, where after successful completion of this tutorial, you should have a Widget Container named “Header Top Widget”.

© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top