June 2012
1 post
This is why we can't have nice things.
programmersbeingdicks:
At this year’s European Ruby Conference (EuRuKo), Eloy Durán gave a delightfully silly talk, involving an a capella singing ‘intervention’ by Dutch group Muziektheater TEER.
Unfortunately, Muziektheater TEER’s singers being all female, and this being a tech conference, the inevitable ensued.
Update: A quick retraction from Michał.
Unfortunately, there’s this, to...
May 2012
2 posts
I’m going to give you a piece of advice when you’re trying to learn something...
– Zed Shaw in Please Don’t Become Anything, Especially Not A Programmer (via skillcrush)
BatchFactory - A Ruby Gem for Parsing Hashes from...
Heyyo,
Find the respository at https://github.com/jumph4x/batch-factory
Scenario
You maintain a large catalog of products and need to keep prices current or
You create records from a spreadsheet your boss hands you or
You have an external service that identifies spammers and you need to get rid of many at a time
Solution
Use tabular input. I chose to support Excel 97-2000 format since...
March 2012
6 posts
Testing Spree 1.0.x Extensions W/ Other Extension...
With a store of any kind of serious size and functionality, one will indubitably find him\herself pulling in a lot of extension dependencies. At 50K products, we have a dozen or so extensions and there have occurred multiple points of overlap.
This means that Extension A decorated some part of Spree and then Extension B came along and further made things more complex. Much like a git conflict,...
Jay Robinson: Quick note on why you should always... →
jayrobinson:
Lately I’ve been doing a ton of reading on decreasing website load time, image optimization techniques, responsive loading for different devices, and every detail I can find in between. One quick takeaway is that I will always tick the “progressive” checkbox in Photoshop’s Save for Web dialog…
Rails Site w/ Old Google Index, Wrong Response...
So we polished up our latest Rails 3 release. It has awesome sitemaps, radical canonicalization, awesome internal link distribution, proper REST. Everything is shiny.
Pulled the trigger, but Google is slow to reindex our content. Hmm, wait 1 week, 2 weeks, 3 weeks. What the hell: indexes all pages but the most important ones - the product browsing pages (Products#index).
What gives?! Boss is...
January 2012
3 posts
Ensuring a Trailing Slash in Rails W/Out...
For some reason this is more difficult in rails than it should be.
The semantic value of the concept of having a trailing slash in the URL is basically one of representing a folder, a virtual directory. In RESTful terms, this represents a collection route, or an :index action. Exhibit A:
GET /products/
This page will list many products as links. In restful terms, this will lead to the :show...
False Positive Tests in Rails, ProTip
False positive tests are a special kind of evil. This is the kind of stuff that will cost you your annual raise.
One of the ways this has recently crept up and done me wrong is very intuitive, yet so hard to find if you look in all the wrong places: caching.
Specifically:
# app/controllers/your_controller.rb
Rails.cache.fetch(you_key) do
# testable code
end
At this point, make sure your...
December 2011
2 posts
Anonymous asked: How are you doing?
Checking for Select.h... Rake Aborted! AKA Wrong...
Was trying to build Webroar on our virtualized box for internal deployments and ran into this.
Required directories created successfully. Building executables...
checking for select.h... rake aborted!
wrong number of arguments (3 for 2)
An hour later…
This is a rake version mismatch. The stuff expects 0.8.7, I had it installed along with 0.9.2 which was where the executable symlink...
November 2011
4 posts
Testing Rails 3.0.9 w/ Spork and Spork-TestUnit:...
Heyyo all,
Quick one. Has this happened to you recently?
/home/denis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- test/unit/testresult (LoadError)
from /home/denis/.rvm/rubies/ruby-1.9.2- p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from...
October 2011
15 posts
JPEG Compression w/ ImageMagick (convert) thru...
So this has been bothering me for a while: 175x85 JPEG weighing in at 84kB.
But I didn’t really get off my ass and do anything serious until now that the Google PageSpeed Tool has been released: https://developers.google.com/pagespeed/
So it tells me this is complete garbage and that I can save quite literally, shit you not, 93% when recompressed losslessly.
Turns out the image is...
4 tags
modeling.
elitefilth:
expert:
rookie:
me:
LIKE A BOSS
September 2011
6 posts
Amazon AWS IAM Group Policy for a Single S3 Bucket
It is stupid how difficult it is to allow a group (or a user) access to only one bucket, or a series of select buckets. Here is the policy allowing a group to access a bucket called MY-BUCKET
{
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::MY-BUCKET"
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource":...
ActionView::Template::Error in Unit Tests (Rails 3...
So I’m resuming development and trying to create coverage for existing code before attempting actual TDD and I get this in my unit tests:
ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
These are unit tests! This is madness! Full error:
AdviceTest:
ERROR test: Advice should belong to...
August 2011
4 posts
jumph4x: lolololol, http://twitter.com/#!/KREAYSHAWN
Kokonut M0nkey: to be a successful celebrity you really have to be an obnoxious attention whore in the entertainment industry
jumph4x: i can hez fame?
Kokonut M0nkey: HAY GUYS, LOOK
jumph4x: maybe ill be famous when i become a notorious public roads drifter
Kokonut M0nkey: I HAD A TACO TODAY
jumph4x: ITS THE YELLO AND PINK RIMS MERCEDES AGAIN, THERE IT FLIES, CLEAR THE ROAD
Kokonut M0nkey: if somebody was gonna be famous it would have been red suit motard man doing wheelies
jumph4x: maybe both could be famous: 'its BLIPMAN AND ROBIN!'
thumper
blip
brap
getit
Kokonut M0nkey: i still have people randomly say "hey i saw you at spring weekend in your suit"
jumph4x: nice
Kokonut M0nkey: including one of my sister's coworkers who slapped my butt
jumph4x: sexy
Kokonut M0nkey: she didn't sound too amused telling me that
Dalli and Angry TypeErrors - Part 3 (SOLUTION)
Continuation to Dalli and Angry TypeErrors - Part 2
And the answer arrives in the form of: another tumblr post. Awesome. Had to Google some longtail keywords to find it, however, so hoping these three blogposts can help lost souls quicker.
Clue #1: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#spawning_methods_explained
This is mod_rails, aka Passenger by Phusion...
July 2011
9 posts
Tune Your 1.9.2 Garbage Collector on EY, Profit
For those of you who have NOT seen James Golick’s cloud performance talk: http://vimeo.com/12814529, time well spent.
Of course, I myself love the cloud for all the right reasons, such as API based deployments and all that jazz. You see, I cannot quite afford a sysadmin and I sure as hell cannot afford to be a sysadmin, but I digress
Yes, 1.9.2
This was news to me too, but if you read...
Dalli and Angry TypeErrors - Part 2
Continuation to Dalli and Angry TypeErrors - Part 1
Here is what the stack looks like at the top, without fail, each and every single time:
[GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/helpers/text_helper.rb:56:in `concat'
[GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/helpers/text_helper.rb:56:in `safe_concat'
[GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/helpers/cache_helper.rb:38:in...
Dalli and Angry TypeErrors - Part 1
Pain in my ass.
I guess it all begins with me moving my code into the cloud. I’m all like:
So having played around with Heroku, carefully studied their pricing structure and having thought up some preliminary plans on how to overcome the whole no-persistent-filesystem thing, I move in for the kill. Postgres switch was painful, a mere foreshadowing of how much more painful the switch...
The Pain
4 years ago, life changed gradually from everything going dandy to everything turning into nightmare. Slowly, but surely. College began. I entered the University of Connecticut and subsequently enrolled in their Computer Science program in the School of Engineering.
The Gain
4 years later I can safely say: what an expensive (and painful) mistake.
No, Really
I was somehow able to keep doing...