Playing with iOS GLKit. Kind of reminds me of Moses in South Park
rubyist ramblings
Programming Love
Currently working on: Learning WebGL
-
2012-04-24
-
2012-04-23
Adam Fields (work stuff): Something is deeply broken in OS X memory management (Lion performance problems part 3)
LION SUXXXXXXSSSS!!!
I’ve been doing some investigation with Perry Metzger into what appears to be a huge problem with memory management in Lion (I, but not everybody, have seen this going back to Snow Leopard, though it’s worse in Lion. This may have something to do with the fact that I was running the 64-bit…
-
2012-03-23
Rails 2->3 Upgrade Part 3
Coming back to this after so many months!
- asset pipeline - wonderful. I had it all implemented via a combination of javascript_include_tag’s :cache option & a rake task that compressed & minified with yuicompressor-2.4.5.
It’s great that Rails finally takes care of this for you, as well as letting me reorganize all my javascripts in more logical directory structures using manifest files for the includes. - Sprockets integration is awesome - I can finally start writing my JS in CoffeeScript! Hopefully convert some of the existing JS too when I get the time.
Probably a good time to start learning SASS too… - form_for: ugh gotta add an
<%=to all those views now. - form_for_remote, link_to_remote: double-ugh. Do I really have to UJS everything?
- auto_link is gone, using Rinku now
gem 'rinku', :require => 'rails_rinku' - cells state methods must be now explicitly accept an opts argument bah.
- routes Lots of typing needed if you have a lot of custom routes like me.
- asset pipeline - wonderful. I had it all implemented via a combination of javascript_include_tag’s :cache option & a rake task that compressed & minified with yuicompressor-2.4.5.
-
2012-03-22
class_inheritable_accessor => class_attribute
Ok some I’m a little late to the Rails 3 party…but this is for those people stuck maintaining large Rails 2 codebases and slowly trying to upgrade.
Anyways the class_inheritable_accessor and class_inheritable_array hack has now been improved. Use class_attribute instead. Source here
-
2012-02-29
Middleman + Backbone.js
Last time I posted about the awesome Middleman app (See “Middleman & Coffeescript”) (how do I link to my posts??), I extolled the wonders of its CoffeeScript integration.
Since I have been deep diving into Backbone.js for a client admin-type project (has YAAI been used for Yet Another Admin Interface?), I found that I could still use Middleman for all the wonderful dynamic development while keeping the Backbone app/ layout intact within source/.
Even better, I can use CoffeeScript to write Backbone.js code.
As you may know, Backbone is a javascript MVC framework which means my M data must be in some DB somewhere right? Well yeah but Backbone cleverly forces you to make all of your application data available via REST API calls, same as Rails.
This means you CRUD your model data using Ajax calls from within Backbone.Of course, the API scripts should’nt have to live on the same dev domain as Middleman, which is typically localhost:4567 anyways. So in order to prevent Ajax calls from breaking due to XSS same-host policy, we must use a Proxy.
Enter middleman-proxy.
Simply setup proxy calls in Middleman’s config.rb and all your Backbone ajax calls will work flawlessly.
My current config looks like this:require 'middleman-proxy' activate :proxy proxy '/api', :to => "my-api-server.local:80"
Flawless Victory!
-
2012-02-14
CoffeeScript => Closure!!
Squee! Free CoffeeScript to JS that can be compiled using Closure compiler’s Advanced mode! hottt
-
2012-02-09
Batch rename commands
This came up recently and took me way too long to explain because I never properly learned awk or sed. Rename all files named foo*.jpg to bar*.jpg:
ls foo*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh -
2012-01-21
html5 notes to self
These will probably be outdated by the time I get to them..but need to keep these around in my L2 cache for at least a few weeks…
Flexbox http://www.html5rocks.com/en/tutorials/flexbox/quick/
-
2012-01-13
Cucumber reminder
I should remember this:
“A step description should never contain regexen, CSS or XPath selectors, any kind of code or data structure. It should be easily understood just by reading the description.” -
2012-01-12
Why is Selenium still so worthless?
It’s been like 3 years or so now guys…come on. I have written hundreds of cucumber features…and I can still run the same cuke and get completely random results each time. Maybe this is a stable framework as long as you’re not dependent on any kind of Javascript/Ajax in your website. Otherwise, I’m still giving up on it.
