Quantcast
Channel: michael f1337 » code
Browsing latest articles
Browse All 9 View Live

maximum perspective

rendererHeight = (height * (projector.focalLength - 1)) / ((Math.tan(projector.phi) / 2) + projector.focalLength);

View Article


Image may be NSFW.
Clik here to view.

Akelos vs. Cake: Let me eat Cake.

I’m still drinking the Ruby Kool Aid, but when I have to PHP in my own well: class User extends AppModel { var $name = 'User'; var $primaryKey = 'user_id'; var $useDbConfig = 'alternate'; } — Cake:...

View Article


Image may be NSFW.
Clik here to view.

Easy Unobtrusive JavaScript with jQuery and Rails

Using 5 (logical) lines of code app/views/layouts/rockets.html.erb: <head> ... <%= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' %> ......

View Article

CakePHP + mod_rewrite on Snow Leopard

Creating a CakePHP 1.2.5 app on a Snow Leopard machine, which comes with PHP 5.3, I encountered the following error when I tried to run the app: “The requested URL...

View Article

CakePHP Command-Line Console in Mac OS X Snow Leopard

The instructions below should work for all versions of Mac OS X. YMMV. You may substitute .profile for .bash_profile. Older versions of Mac OS X may need to substitute “nano” for “pico”. nano...

View Article


Separating behavior and persistence in models

Link: Separating behavior and persistence in models — @engineyard via @lukebayes Recall the Single Responsibility Principle: “There should never be more than one reason for a class to change.” As we...

View Article

Debugging PHP + cURL Using Charles Proxy

To debug/inspect cURL requests and responses in PHP, proxy the requests through an HTTP proxy like Charles: curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1"); curl_setopt($ch, CURLOPT_PROXYPORT, 8888); To...

View Article

Line Breaks and Multiline Strings in YAML

A simple introduction courtesy of Symfony: Folded style, introduced by > # Each line break is folded to a space # Makes YAML more readable accomplishment: > Mark set a major league home run...

View Article


Catching the “Little Things” with BDD

I’ve often read/heard the following kind of critique comparing TDD (Test-Driven Development) and BDD (Behavior-Driven Development): BDD is great, but unlike TDD, it can’t catch little things like...

View Article

Browsing latest articles
Browse All 9 View Live