Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
16 total  XML / RSS feed 

Medge's Bean Chili

A really hot one and best served with corn chips! Found it in Open Source Cookbook in my favorite recipe organizer.
Haven't tried it with the dry white wine yet :P

INGREDIENTS
2 large onions, diced
1 tsp   minced garlic
1 tsp   minced ginger
1 whole red bell pepper, diced
1 tbsp  basil leaves
1 tbsp  mixed herbs
1 can    (10 oz) tomatoes
1 can    (10-14 oz) kidney beans, drained


DIRECTIONS
1. Fry peppers, garlic, and onions in a sauté pan until the onions begin to turn soft. 
2. Add tomatoes (with juice), beans, and herbs.
3. Reduce heat, and simmer for at least 30 mins (more is better)
4. Serve with rice, yogurt, and corn chips (or all of these), and Alacante, any clear dry white wine, or even frontinac.

Solaris Capistrano deploy.rb

// capiwhatisit recipe for solaris
// most important thing is overriding some tasks to use GNU ln, since solaris' ln are subtly different

set :application, "awesomeapp"
set :repository, "http://example.com/repos/#{application}/trunk"

role :web, "foo.com"
role :app, "bar.com"
role :db,  "baz.com", :primary => true

set :deploy_to, "/path/to/app"
set :user, "appuser"
set :svn, "/opt/csw/bin/svn"
set :rake, "/opt/csw/bin/rake"
set :mongrel_config, "#{deploy_to}/shared/config/mongrel_cluster.yml"

set :use_sudo, false

desc "The spinner task is used by :cold_deploy to start the application up"
task :spinner, :roles => [:web, :app, :node] do
  run "/opt/csw/bin/mongrel_rails cluster::start -C #{mongrel_config}" # or SMF
end

desc "Restart the Mongrel processes on the app server."
task :restart, :roles => [:web, :app, :node] do
  run "/opt/csw/bin/mongrel_rails cluster::restart -C #{mongrel_config}" # or SMF
end

desc "Symlinks the database.yml into the current release"
task :after_update_code, :roles => [:web, :app, :node] do
    run "/opt/csw/bin/gln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end

# Run rake migrate after the symlinking has been done, just because I'm a lazy bum
task :after_symlink, :roles => :db do
  backup
  migrate
end

# =====================================================================================
# = Overriding these tasks because we need to use GNU ln and need the full path to it =

desc <<-DESC
Update the 'current' symlink to point to the latest version of
the application's code. Using GNU ln
DESC
task :symlink, :roles => [:app, :db, :web, :node] do
  on_rollback { run "/opt/csw/bin/gln -nfs #{previous_release} #{current_path}" }
  run "/opt/csw/bin/gln -nfs #{current_release} #{current_path}"
end

desc <<-DESC
Rollback the latest checked-out version to the previous one by fixing the
symlinks and deleting the current release from all servers.
DESC
task :rollback_code, :roles => [:app, :db, :web] do
  if releases.length < 2
    raise "could not rollback the code because there is no prior release"
  else
    run <<-CMD
      /opt/csw/bin/gln -nfs #{previous_release} #{current_path} &&
      rm -rf #{current_release}
    CMD
  end
end



How to ssh into Ubuntu on Parallels by hostname

this is something that strangely doesn't happen automatically on ubuntu
in Ubuntu, just add
send host-name "dapperbox";

to your /etc/dhcp3/dhclient.conf file

you might need to do a
sudo /etc/services/networking restart


On your Mac, you can now do
ssh username@dapperbox


instead of

ssh username@1.2.3.4

My mom's recipe for okroshka (cold soup)

Ingredients:
Bunch of spring onions
0.5 kg of cucumbers 
4 potatoes
5 eggs
Bunch of fennel
1 carrot
3 garlics
0.5 kg of a boiled sousage
Sour cream
1L of kefir


Boil water and let it to get cold.
Put all sour cream and kefir there.
Boil 4 not so small potatoes and 1 carrot.
Boil 5 eggs and then put them under cold water.
While everything is boiling crumble cucumbers, spring onions (only green part), a fennel, garlics and a sousage.
Let potatoes and a carrot to get cold and then crumble them too.
Put everything into the water.
Salt and pepper to your taste.
Put it into a refrigerator and let it to get really cold.

Bon appetit!

DRY up empty controller actions

Ever create Rails views that don't user the controller at all just to take advantage of an application layout?
If you have, you may have a lot of code that looks like this:


class HelpController < ApplicationController
  def index
  end

  def tutorial
  end

  def faq
  end
end


Well, there's a simple way to make this a lot cleaner...


class ApplicationController < ActionController::Base
  def self.simple_action(*actions)
    actions.each {|action| class_eval("def #{action}; end")}
  end
end

Now your controller can look like this instead...

class HelpController < ApplicationController
  simple_action :index, :tutorial, :faq
end

Quickly concatenating PDF files with teTeX utilities

Using utilities from the standard teTeX distribution, it's possible to quickly and easily concatenate multiple pdfs together from the command line.

To concatenate 1.pdf, 2.pdf, 3.pdf into a single file 123.pdf you can use the command

texexec --pdfarrange --result 123.pdf 1.pdf 2.pdf 3.pdf


To concatenate all pdf files in a directory into a single file all.pdf you can use

texexec --pdfarrange --result all.pdf *.pdf

Real good Granola

- Ingredients:

3 cups rolled oats
1 1/4 cups bran flakes
3/4 cup shredded coconut
1/2 cup walnuts
1 cup sliced almonds
3/4 cup salted sunflower seeds
2 teaspoons cinnamon
2 1/2 teaspoons pure maple syrup
honey (1/3-1/2 cup depending on taste)
canola oil (1/3-1/2 cup)

Preheat oven to 350 degrees. Cover baking sheets with wax paper and grease with cooking spray. Combine oats, bran flakes, coconut, walnuts, almonds, sunflower seeds, and cinnamon in a large bowl. Mix maple syrup, honey and oil in small bowl; add to dry mixture and stir until well mixed. Spread on cookie sheet(s) and bake for 20-25 minutes until golden brown, tossing granola halfway through baking time to keep edges from burning. Cool completely before storing.

Good Eats Roast Turkey

Recipe courtesy Alton Brown
Show: Good Eats
Episode: Romancing the Bird (A Good Eats Thanksgiving)

1 (14 to 16 pound) frozen young turkey
For the brine:
1 cup kosher salt
1/2 cup light brown sugar
1 gallon vegetable stock
1 tablespoon black peppercorns
1/2 tablespoon allspice berries
1/2 tablespoon candied ginger
1 gallon iced water
For the aromatics:
1 red apple, sliced
1/2 onion, sliced
1 cinnamon stick
1 cup water
4 sprigs rosemary
6 leaves sage
Canola oil

Combine all brine ingredients, except ice water, in a stockpot, and bring to a boil. Stir to dissolve solids, then remove from heat, cool to room temperature, and refrigerate until thoroughly chilled.
Early on the day of cooking, (or late the night before) combine the brine and ice water in a clean 5-gallon bucket. Place thawed turkey breast side down in brine, cover, and refrigerate or set in cool area (like a basement) for 6 hours. Turn turkey over once, half way through brining.
A few minutes before roasting, heat oven to 500 degrees. Combine the apple, onion, cinnamon stick, and cup of water in a microwave safe dish and microwave on high for 5 minutes.
Remove bird from brine and rinse inside and out with cold water. Discard brine.
Place bird on roasting rack inside wide, low pan and pat dry with paper towels. Add steeped aromatics to cavity along with rosemary and sage. Tuck back wings and coat whole bird liberally with canola (or other neutral) oil.
Roast on lowest level of the oven at 500 degrees F. for 30 minutes. Remove from oven and cover breast with double layer of aluminum foil, insert probe thermometer into thickest part of the breast and return to oven, reducing temperature to 350 degrees F. Set thermometer alarm (if available) to 161 degrees. A 14 to 16 pound bird should require a total of 2 to 2 1/2 hours of roasting. Let turkey rest, loosely covered for 15 minutes before carving.

(c) Food Network, Alton Brown

Gingered Sweet Potato Puree

Recipe courtesy Sara Moulton

2 tablespoons butter
1 cup chopped onions
8 medium sweet potatoes
3/4 cup milk
4 tablespoons butter
1/4 cup candied ginger, chopped, or to taste

Saute onions in butter until translucent. Set aside. Peel potatoes and cut into 1-inch pieces. Place potatoes in saucepan with cold salted water to cover and boil, covered, until very tender, about 15 minutes. Drain in colander. In a food processor, puree potatoes, milk, butter and Sauteed onions until smooth. Season with salt and pepper. Sprinkle with chopped candied ginger.

(c) Food Network, Sara Moulton

Fried mac 'n' cheese

Recipe Summary
Difficulty: Easy
Prep Time: 20 minutes
Cook Time: 5 minutes

Leftover baked macaroni and cheese, refrigerated for at least overnight
1 cup all-purpose flour
1 teaspoon salt
1 teaspoon pepper
1 teaspoon cayenne
1 egg beaten with 2 ounces water
1 cup panko bread crumbs
Oil for deep frying, preheated to 375 degrees

Cut refrigerated macaroni and cheese into slices or bite size pieces.
Season the flour with salt, pepper and cayenne. Dredge each piece through the flour and gently tap off excess. Dip in the egg wash and then coat with the bread crumbs. Allow them to rest for 5 minutes so the crust can set. Very carefully drop into the oil and fry until golden brown. Remove to a baking sheet fitted with a rack and rest for 2 minutes before serving.

(c) Food Network, Alton Brown

The Chewy

Recipe Summary
Prep Time: 20 minutes
Cook Time: 15 minutes
Yield: 2 1/2 dozen cookies

2 sticks unsalted butter
2 1/4 cups bread flour
1 teaspoon kosher salt
1 teaspoon baking soda
1/4 cup sugar
1 1/4 cups brown sugar
1 egg
1 egg yolk
2 tablespoons milk
1 1/2 teaspoons vanilla extract
2 cups semisweet chocolate chips
Hardware:
Ice cream scooper (#20 disher, to be exact)
Parchment paper
Baking sheets
Mixer


Heat oven to 375 degrees F.
Melt the butter in a heavy-bottom medium saucepan over low heat. Sift together the flour, salt, and baking soda and set aside.

Pour the melted butter in the mixer's work bowl. Add the sugar and brown sugar. Cream the butter and sugars on medium speed. Add the egg, yolk, 2 tablespoons milk and vanilla extract and mix until well combined. Slowly incorporate the flour mixture until thoroughly combined. Stir in the chocolate chips.

Chill the dough, then scoop onto parchment-lined baking sheets, 6 cookies per sheet. Bake for 14 minutes or until golden brown, checking the cookies after 5 minutes. Rotate the baking sheet for even browning. Cool completely and store in an airtight container.

(c) Food Network, Alton Brown

Watermelon Gazpacho

Very good for summer - from my site: http://iolaire.net/current_site/blog.php/archives/2004/08/03/a-very-good-recipe-watermelon-gazpacho/

Watermelon Gazpacho
* 1 Seedless Watermelon, dice small
* 4 Cucumbers, seeded, dice small
* 4 Celery stalks, dice small
* 2 Red Peppers, dice small
* 2 Green Bell Peppers, dice small
* 1 Red Onion, dice small
* 1 Bunch Green Onion, sliced
* 1 Bunch Cilantro, chopped
* 3 oz Olive Oil
* 3 oz Sherry Vinegar
* 2 oz Cayenne Pepper
* 2 oz Cumin

Mix all ingredients together and chill for two or more hours before serving.

Remember that you are having fun and trying to make something that tastes good, thus modify recipe as needed.

Baked macaroni and cheese

From my ex-mother-in-law. Best stuff I've ever had (no surprise, she's from Wisconsin.)

Ingredients:
3 tbsp butter
1 onion (chopped)
4 tbsp flour
2 cups milk
7-8 oz. cooked elbow noodles
8 oz. Kraft American cheese (cubed)
6-8 oz. sharp cheddar cheese (shredded)
1 tbsp dry mustard
1 dash cayenne pepper
1 dash salt
1 dash nutmeg

Hardware:
Buttered casserole dish
Large saucepan

Prep:
1. Separate out 4 oz. of sharp cheddar cheese
2. Separately cook the elbow macaroni however indicated on its packaging
3. Pre-heat oven to 375�

Instructions:
1. In the saucepan, saut� the butter and onion until the the onion is translucent
2. Add flour, cook until it is fully incorporated, then take off the stove
3. Add the milk, put back on the stove and bring to a simmer
4. Add dry mustard, cayenne pepper, and salt
5. Add (slowly and until melted) the Kraft American cheese and 4 oz. of sharp cheddar cheese
6. Add the cooked elbow macaroni
7. Mix very, very well then pour the mixture into the casserole dish
8. Sprinkle the remaining 2-4 oz. of cheddar cheese over the top
9. Bake in 375� oven for 30 minutes

Italian peasant's salad

From Enrica http://asiatica.org/~enrica/

Ingredients

* boiled patatoes (cold)
* olives (black or green)
* ripe tomatoes
* finely chopped onions
* salt
* oregano or 3-5 basil leaves
  (not washed just cleaned)
* freshly battered extra-vergin olive oil and vinegar
  (please please do not use the so called "Italian dressing", which is fake)


Optional Ingredients

cubes of pecorino (sheep) cheese or mozzarella


Directions

Add tomatoes at the end, use cold potatoes, and do not put too much of anything: too much is not better, is just too much; anyway, this is not a minimalist salad either, so do not be stingy either: in medio stat virtus!

Garlic Rosemary Mashed Potatoes

Here's another winner I busted out at Thanks Giving. I modified it slightly in that I used a potato ricer so as not to over mash and render them gluey (originally found on http://www.allrecipes.com/ and tips specifically from here)

Ingredients
2 pounds potatoes 
4 cloves garlic 
1/4 cup freshly grated 
   Parmesan cheese 
1 tablespoon butter or margarine 
1 tablespoon chopped fresh rosemary 
1/2 cup Evaporated Lowfat Milk 
salt and ground black pepper to taste


Directions
1 PLACE potatoes and garlic in large saucepan. Cover 
   with water; bring to a boil. Cook over medium-high heat 
   for 15 to 20 minutes or until potatoes are tender; drain. 
2 RETURN potatoes and garlic to saucepan. Mash potatoes and
 garlic together with a potato ricer. Add cheese, butter and 
   rosemary; stir until smooth (but not too much). Gradually stir in evaporated milk. Season with salt and pepper.

Cranberry Chutney

I made this for last Thanks Giving (Canadian) and it was well received by all, even my mother who likes her festive dinners to be on the traditional side. (originally found on http://www.allrecipes.com/)

Ingredients:
1 cup water 
3/4 cup white sugar 
1 (12 ounce) package fresh cranberries 
1 cup apples - peeled, cored 
   and diced 
1/2 cup cider vinegar 
1/2 cup raisins 
1/2 teaspoon ground cinnamon 
1/4 teaspoon ground ginger 
1/4 teaspoon ground allspice 
1/8 teaspoon ground cloves


Directions
1 In a medium saucepan combine the water and sugar. Bring 
   mixture to a boil over medium heat. Add the cranberries, 
   apples, cider vinegar, raisins and spices. Bring to a boil, 
   then simmer gently for 10 minutes stirring often. 
2 Pour mixture into a mixing bowl. Place plastic wrap 
   directly on the surface of the sauce. Cool to room temperature 
   and serve or cover and refrigerate. Bring chutney to room 
   temperature before serving.
« Newer Snippets
Older Snippets »
16 total  XML / RSS feed