January 15th, 2010
I started taking voice lessons. For christmas I got a course called Brett Manning’s Singing Success. I’m hoping that it will improve my range and voice quality. Once I get brave enough I’ll document my progression with some audio clips. I am recording my progress so at some point I should be able to hear the difference.For now, I can sing comfortably between F below C4 and an C5-A flat or on a it’s guitar F on the low string to an A flat on the high E string. Right now, my vocal warm up’s consist:
- Warm up with humming high to low
- Lip roll scales
- Pitch exercises - this is where I play a note on the piano and match the pitch and hold for 10 sec
- Nay, nay, nay scales
- Warm down the same as warming up
Posted in Music | No Comments »
May 22nd, 2009
I was lead down some interesting paths figuring out this simple flow. So I thought I’d post it to save some time…and hopefully someone else’s.
Also, here’s a nice cheetsheet: http://cheat.errtheblog.com/s/git
# Sets up a local branch
git branch my_test
# Creates the remote branch
git push origin my_test
# Deletes a remote branch
git push origin :my_test
# Delete branch locally
git branch -d my_test
UPDATE: (5/27/2009)
Get a remote branch that exists on the server but not locally (tracking is set by default)
git checkout -b my_test_prod origin/my_test_prod
Posted in Uncategorized | No Comments »
December 4th, 2008
Great packaged installer for Postgres. http://www.postgresqlformac.com/
ALSO
Edit Global Bash ProfileYou need to edit the global bash profile as follows:
- Open the Terminal application.
- Type sudo pico /etc/profile
- You will be prompted to enter your password.
- Add the following text to the end of the file:
export PATH=/Library/PostgreSQL8/bin:$PATHexport PGDATA=/Library/PostgreSQL8/dataPostgreSQL8 in the above text might be something different depending on the version you installed. Check on your computer in the HardDrive/Library/ folder to verify the name of your installed PostgreSQL folder.
- Press Ctrl+x to Exit. Press y to save the changes. Press the Return key to save the file.
Copied from: http://www.studiotips.net/docs/tips_sql/postgresql/installingpostgresqlonmac.html
Posted in Uncategorized | No Comments »
November 17th, 2008
A while ago (Nov. 2006) was looking for a solution to Roles and Permissions for Ruby on Rails. One idea on the RoR site is to create an Access Control List (ACL), create a before filter and allow certain roles to certain actions. This seemed like a lot of extra work. Especially if you have to do this to each controller. Plus you have to maintain it! I wanted something more dynamic–cooler. Plus, it places an unnecessary dependency between me and my code. I want to solve problems, not add/remove permissions.
Enter acts as role. Written with my friend Jon Morton, AAR allows for role/permission simplicity through-out a Rails application. We followed these guidelines when writing AAR - Had to:
- have model based security
- protect Controller actions
- simple to code in the View
- hide items easily in the View
- database driven, have no ACL list in the code
- allow multiple roles
- and handle permission conflict intelligently
Understanding Users/Roles/Permissions
AAR’s basic principle is that you should not give special permissions directly to the User. All permissions are given to a Role. If there is a snowflake** who needs X permission then I copy an existing Role and add the permission. This way if (or when) that user is gone the permissions and are preserved.
Installation can be a simple as downloading the app, putting it in your vender/plugins directory and adding “include ActsAsRole” at the top of your controllers/application.rb. Correction. There are models and relationships that need to be set up that I have not explained. I’ll work on updating the README to include this. And add some rake tasks to the plugin to create the models. See the DB Schema PDF to see the model associations.
EXAMPLE of using AAR:
if has_access?(users_path)do something…end
OR
if has_access?(:controller => ‘users’, :action => ‘index’)do something…end
In Part 2, I’ll have a screencast and a test app.
Links:
git AAR
model schema diagram pdf
** Jon Bartels, fellow programmer who coined the edge cases as “snowflakes”…because everyone wants to be special and unique.
Posted in Ruby on Rails | 2 Comments »
November 10th, 2008
Another small issue I came across this weekend is when I type in a bogus URL in my rails app. i.e. http://localhost:3000/asdf
routes.rb maps routes for a Rails app and they are checked in order. So if we add a route at the end of that list it will assume that the route didn’t match any previous route. Here’s a sample:
map.connect ‘*some_attribute’, :controller => application
Any route that hits this will be sent to the application/index. Here is simple fix for the index method:
def index
logger.error exception.backtrace.join(”\n”)
render :template => “my_error_page”, :status => :not_found
end
Posted in Ruby on Rails | 2 Comments »
November 6th, 2008
When building a Rails invariably I have some conditions that needs to be handled that fall outside of “normal” behavior. I also want to display something nice to the user, log the error and respond to the browser with the correct HTTP response code. This can be used per controller or system wide in the application controller.
rescue_from ActiveRecord::RecordNotFound do |exception| logger.error exception.backtrace.join(”\n”) render :template => “record_not_found”, :status => :not_foundend
API Reference: rescue_from
Posted in Ruby on Rails | 2 Comments »