April 2012
1 post
If you double your price, then offer a 50%...
Gilt offers 10 Omaha Steaks 6oz. Filet Mignons at 40% off $165 for $99.
Omaha Steaks offers 10 Omaha Steaks 6oz. Filet Mignons at 33% off $165 for $109.00
Not much of a sale, Gilt.
December 2011
3 posts
Rails path vs url helpers
Manually re-blogged from http://ianlotinsky.wordpress.com/2010/09/24/rails-path-and-url-helpers/
Sometimes I forget the simple differences between Rail’s helpers. This mini post is so I don’t forget. *_path Generates relative URLs: /users Used in views by link_to, form_for, etc. (per DHH) The browser maps relative URLs to absolute URLs based on the current page’s protocol and host (/users on the...
September 2011
5 posts
RandoNum.com - The Place To Get Your Daily Number
In today’s modern society, how often do we find ourselves logging into websites and obsessing over the numbers that come out? Logging in to check our Twitter followers, our 401k portfolio, our pay-per-click advertising campaign click through rate, our bank accounts, how many people are occupying Wall St., how many jobs we’re losing, your Klout score, how many votes Obama is gonna get.
...
6 tags
Which is sexier?
Mercedes-Benz SLK350 Roadster
OR
Bertelli Lugged Steel, Single-speed Bike
August 2011
2 posts
Onepager: Take That First Step and Start Your New... →
onepagerapp:
Millions of people* sit at their desk jobs, bored, dreaming up side businesses they can start while “working” to make a little extra cash. These people aren’t greedy or trying to screw their company over, in fact they’re usually the most clever and hardest working.
This was me a few years…
Onepager, the simplest way to create a small...
The history of my life (in bulleted list form):
Born in the Heartland of ‘merica
Lived in Queens
Lived in NJ
Graduated college
Worked as a Microsoft developer, first VBScript ASP, then C# .NET
Freelanced as Ruby on Rails and PHP developer
Started a service company, Simande
And as of this month:
Started a product company, Onepager
July 2011
1 post
How I installed MySQL, RVM, Ruby, and Rails on...
Install MySQL on Lion (Mac OS X 10.7)
Download the 64-bit .dmg of MySQL and install everything it comes with.
Add the following lines to your ~/.profile file
export CC=/usr/bin/gcc-4.2
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
Go to the MySQL panel in System Preferences and start your MySQL Server
Then run these commands in terminal:
cd /usr/local/mysql
sudo...
February 2011
1 post
Interesting Convo between DHH and Obie over...
DHH: “It’s a sure thing unless you’re the fool left holding the bag when the road comes to an end. And the road will end.”, http://bit.ly/gb8pfl
Obie: @dhh Why do you care? You do your thing well and mint money. What fools are doing with their money should be the least of your worries
DHH: @obie Are you serious? So nobody should care that suckers bought worthless inet...
December 2010
2 posts
LivePerson with Nikola from App Sumo
Last month a friend of mine, Stephan Weitberg, sent me a link to the current App Sumo deal which included a bunch of “developer apps” for the low low price of only $47. All of a sudden a chat box pops up asking me how its going! Like those people who have long responses when bums harass people for change, I decided to engage Nikola.
nikola: …believe it or not, I’m...
Dear Matt Hunter
Dear Matt Hunter,
In reply to your tweet regarding the Facebook Gem, and my subsequent message on GChat about “Facebooker,” I would like to offer you a convenient link to the Facebooker gem. I wish you the best of luck with it (trust me, you’ll need it). Finally, I would like to multi-modally thank you for the introductions leading to today’s Fred Wilson post about We...
November 2010
2 posts
We Are NY Tech →
A site that features the people of NY Technology - wearenytech.com
October 2010
2 posts
Twitter's Ruby on Rails roots
A screenshot of Twitter’s account management page, complete with the default FormHelper error_messages generated HTML (now removed from Rails 3 and available as a plugin).
Bitly calls Google "Your Mom"
September 2010
5 posts
Your 10k Apart
We lost the 10k Apart contest, so I figured I’d upload the screen that appears when you submit your entry:
What I Learned from Startup Bootcamp 2010
Just start programming and build something.
Keep focused and always have a plan that you must change/adapt as necessary.
Be nice to everybody and grow your network.
Chris Wanstrath, founder of GitHub
Its okay if your idea is unoriginal, mundane, or has a terrible pitch. Github was created as a tool to help the founders build their original startup idea, Famspam, a way for family members to...
2 tags
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:103...
Just upgraded from Ruby 1.9.1 to 1.9.2 and Passenger (mod_rails) was throwing some crazy errors. The “gem” command was also throwing some errors. Turns out rubygems is trying to read your gems from an old 1.9.1 directory. The fix is to delete everything rubygem-related in /usr/local/lib/ruby/site_ruby/1.9.1/.
Some links for further reading on the issue:
...
The Best Twitter HashTag Regular Expression
I personally guarantee that this is the best Twitter hash tag regex in the world, until you prove me wrong.
This is my fool-proof methodology:
I tweeted a string with randomly placed hash tags, saw what Twitter did with it, and then tried to match it with a regular expression. Here’s what I got:
/\B#\w*[a-zA-Z]+\w*/
10k Random, a word game.
A little word game my friend, Matthew Moore, and I made for An Event Apart competition to create an HTML5/CSS3/JavaScript application under 10K.
http://10k.aneventapart.com/Entry/400
August 2010
1 post
How to grep your server log files for number of...
Sometimes you’re on the run and just don’t have time to deal with Google Analytic’s fancy JavaScript charts. This will give you the number of unique IP addresses in a log file:
grep "" mylogfilename.access.log | awk '{print $1}' | sort | uniq | wc -l
This will get you the number of uniques on August 2nd.
grep "2/Aug" mylogfilename.access.log | awk '{print $1}' | sort | uniq...
July 2010
1 post
Ally Bank Uses Taro Ice Cream For Ad
My favorite kind of ice cream, taro (from Chinatown Ice Cream Factory), is displayed prominently in this Ally ad:
June 2010
3 posts
Apple iPhone Pre-order Ships By July 14nd
Setting up monit on Ubuntu
How to set up monit on Linux
sudo aptitude install monit
sudo nano /etc/monit/monitrc
Make sure to change the default apache location to:
check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
and here are the additional lines I comment out / add:
set daemon 60
set...
May 2010
3 posts
Rails CKEditor and Paperclip without the...
Tried to install Rails CKEditor w/ image/file upload today:
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /var/folders/... is not recognized by the 'identify' command.>
Turns out the default code on Rails CKEditor tells Paperclip to auto-generate a thumbnail image for you, which requires ImageMagick.
:styles => { :content =>...
Htaccess Redirects, Rails Single Resource Routing,...
In addition to a helpful 404 page, sometimes its nice when you re-engineer an entire major site to check out the top pages from the old site and do some manual redirects in your .htaccess.
Redirect 301 /old-url http://www.domain.com/new-url
Routing for a Singleton Resource on Rails 2 (re-printed from http://www.expressionlab.com/2008/7/14/routing-for-a-singleton-resource-on-rails-2)
While...
April 2010
6 posts
MailChimp + Shopify = Chimpified
http://andand.rubyforge.org/ →
RubyOnRails.org FAIL
Ruby Regular Expressions
Rubyular
Don’t you hate when you cut your lip on plastic utensils?
Best non-played out joke ever: Hold an iPad up to your face and go “HELLO?”
More jQuery ajax nuances
If your ajax call is looking for json back…
$.ajax({
type: "POST",
dataType='json',
url: url,
success: function(data, textStatus) {
console.log('Throw a party');
}
});
…but it gets nothing back but a blank string…
def party_hard
respond_to do |format|
format.html { redirect_to '/feed', :status => 400 }
format.js { head :ok }
end
end
the...
Crazy jQuery and Rails errors that occur at 2AM
When trying to make a jQuery ajax request, don’t get JSON happy and set everything to JSON. Read the documentation instead.
contentType - When sending data to the server, use this content-type.
dataType - The type of data that you’re expecting back from the server.
If you set contentType to application/json and try to make ajax POST requests with a serialized form, crazy...
March 2010
7 posts
MySQL Cheat Sheet - Create new user, give user...
Create Database
create database microsoftaccess;
Create User
create user ‘chairthrower’@’localhost’ identified by ‘welcome1’;
Grant Permissions
grant all on microsoftaccess.* to ‘chairthrower’@’localhost’;
Export
mysqldump -u root -p microsoftaccess > microsoftaccess.sql
Import
mysql -u root -p...
ActiveRecord, DateTime, Time Zones and You
When you create an ActiveRecord Model and save it to the database (Model.create), Rails stores the current time in UTC, not your current time zone. When you retrieve the record (Model.find), Rails converts the time from UTC back into your own time zone.
Problems arrive when you try to find your records by a specific time:
Model.find(:all, :conditions => ["created_at < ?", Time.now]
or...
2 tags
I am so glad HTML 5 is killing flash slowly with...
Ever get really confused by the same thing for 10 minutes before realizing “OH I’VE DONE THIS 100 TIMES BEFORE!!!” I hope this note to self will fix it for next time.
Note to self: Before you waste 10 minutes figuring out why a flash[:notice] either a) isn’t working or b) is sticking around for one refresh too long, remember that flash.now works only for the current...
3 tags
How to install a plugin from a git repository...
Was implementing nested_has_many_through and came across this error:
Cannot dissociate new records through 'Post#post_tags' on '#'. Both records must have an id in order to delete the has_many :through record associating them.
Apparently I needed to use the rails-2.3 branch, which you can install like so:
script/plugin install git://github.com/username/repo.git -r branch_name
2 tags
Globally Unique Identifier is a proper noun.
Dear WordPress:
Why is there a field in your wp_posts table called guid of type varchar that stores the unique URL for a post? That’s like me hanging a sign on my dog that says “CAT” or painting my rosewill computer red and calling it an “apple.”
Sincerely,
E
2 tags
iPad Jokes, Two Ways
Shakshouka!
February 2010
5 posts
2 tags
tar: Cowardly refusing to create an empty archive
Gotta love software that’s humble and knows its place. With all these “innovative, industry shaking, market disrupting” social networking web 2.0 iPhone apps out there that are “simple, beautiful, easy-to-use, doesn’t get in the way,” its nice to be reminded by tar that software can be humble.
If you do this, it won’t tar hidden (like .htaccess)...
http://www.iblogwhatieat.com/mccormick-schmick’s-se... →
3 tags
Parse a WordPress RSS XML Feed with Hpricot
One cool thing about wordpress is that you can get a feed of a specific category by going to /category/category-name/feed or a specific tag by going to /tag/tag-name/feed
require 'open-uri'
require 'hpricot'
doc = Hpricot.parse(open("http://myawesomeblog.com/category/welcome/feed"))
(doc/:item).each do |xml_product|
puts xml_product.search("/title").first.children.first.raw_string
puts...
2 tags
How to set up chroot for SFTP users
My hatred of plain FTP is well documented, but I needed change the root directory of a new SFTP user to their home folder (/home/user) so they can’t navigate back to / on the server.
Do your usual create new user stuff:
mkdir /home/steveperry
useradd steveperry
chown root:steveperry /home/steveperry
chmod 755 /home/steveperry
Force the normal login directory just in case:
usermod -d...
2010 - The Year Google Drops Support for IE6 and...
What do the following companies have in common?
Google, worth $170 Billion
Apple, worth $180 Billion
Facebook, worth anywhere from $6-$15 Billion
THEY ALL DROPPED SUPPORT FOR IE6!
http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html