Tuesday, September 01, 2015

Run iPhone simulator from command line (Xcode 6)

From the command line (terminal):


open "/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app"


Or in newer versions:

open "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app"

Wednesday, September 25, 2013

Free and Fast Way to Accurately Convert PDFs to Excel Files

Anyone working with tabular data on a regular basis knows that Microsoft Excel is the preferred program for manipulating this type of material for most people. The Excel spreadsheet is an industry standard when it comes to presenting numbers or statistics and working with them. And while Excel is the most popular program for using this type of material, you might not always receive this data from others in the Excel format.

It’s not uncommon for people to convert tabular data to PDF before sending it to others. PDF is not only easily compressed into a small file size and, therefore, easy to send and transfer, but it is also a universal file format that appears identically on every platform. But with all of these advantages of the PDF, it has one fairly big disadvantage – it’s hard to edit.


So if this does occur to you on a regular basis and you need to convert your PDFs into Excel, thankfully, there are ways to do so effectively and cost free.

PDFtoExcel.org is one tool that enables users to quickly turn their PDFs into Excel files, without losing any of the formatting and structure of the PDF document.

pdf to excel


For a free tool, it’s incredibly accurate with its conversions, and it’s also very easy to use.

To use the tool, click Browse to find the PDF file on your computer that you want to have converted. 


Now simply enter your email and click Send – that’s it!




In a matter of minutes, your converted Excel file will be ready. An email with a link to your downloadable Excel file will be sent to the address that you specified.



The accuracy of the service is what really sets it apart from many other free services. When converting from PDF to Excel, it’s important to get accurate conversions so that the formatting of the cells and rows is preserved. This saves you a lot of time that you could potentially have to waste on editing the converted file further before being able to use it.

The tool is not only incredibly accurate in its conversions, but it’s also very secure and safe to use. Your email address and files will be deleted from the server permanently 24 hours after the conversion has been completed.

For anyone looking for a free and fast way to accurately convert PDFs to Excel files, PDFtoExcel.org is definitely one of the best online tools available for this purpose.

This guest post was written by the nice folks at PDFtoExcel.org. Do check out their tool and let me know if it worked for you in the comments below.

Saturday, June 29, 2013

Can't embed Youtube video iframe in Magento

What you need to do is select the checkbox that reads 'Use old embed code.' This will give you some code that uses the 'object' tag and 'should' work:




This is working on Magento ver. 1.6.1.0.


Sunday, June 09, 2013

new field not being detected cakephp


1. Find the file:

/app/Config/core.php

2. Make sure the following configuration is set:

Configure::write('debug', 2);

The new database field will only be detected if the debug level is set to 2.

Monday, June 03, 2013

PHP Fatal error: Call to undefined function imagecreatetruecolor() in /var/www/lib/Varien/Image/Adapter/Gd2.php

It's likely the gd library is not installed/enabled.

Remedy this (in Ubuntu) by installing php5-gd using apt-get, like so:

apt-get install php5-gd

Then restart apache.

sudo apachectl restart 

Sunday, March 17, 2013

Magic Mouse Slow Mac

If, like me, you're someone who likes to have your mouse on maniac speed settings, but doesn't like the slow speed that MacOS gives you even with the fastest setting.

1. Do it by the command line via terminal (which involves restarting your machine each time you set it).  Using something like this:

defaults write -g com.apple.mouse.scaling 5.0

or

2. Download this nice little tool, which changes the setting instantly:

http://blog.boastr.net/

Thursday, March 14, 2013

Failed to download pear/XML_svg2image within preferred state "stable"



When running this: pear install XML_svg2image

Getting the error:
Failed to download pear/XML_svg2image within preferred state "stable", latest release is version 0.2.0, stability "beta", use "channel://pear.php.net/XML_svg2image-0.2.0" to install
install failed

Solution, run this:
pear install XML_svg2image-0.2.0

Wednesday, March 06, 2013

Tuesday, January 29, 2013

Safari. How to send message from popover to global

In essence you don't need to because you still have access to the safari.extension object in your popover.

So instead of sending a message 'foo' you can simply make a function inside your global page called 'foo()' and call it like so from your popover:

safari.extension.globalPage.contentWindow.foo();


Read this thread:

http://stackoverflow.com/questions/12663743/how-do-i-pass-a-message-from-a-safari-extension-popover-to-the-global-page

Wednesday, January 09, 2013

Nano find and replace

Nano is a great little tool for doing quick stuff on linux. (vi is too!).

To do a find and replace using nano use "Ctrl + \"

Tuesday, December 11, 2012

9 Books on UX Design for the Budding UX Designer

Essentially my UX skills suck and I need to start reading some books on UX design. According to the internets these are where I should get started.

1. A Project Guide to UX Design
Russ Unger
(NLB Singapore | Amazon)

2. The Elements of User Experience
Jesse James Garrett
(NLB Singapore | Amazon)

3. Don't Make Me Think (Seems Highly Recommended)
Steve Krug
(NLB Singapore | Amazon)

4. Content Strategy for the Web
Kristina Halverson
(NLB Singapore | Amazon)

5. Information Architecture for the Web
Peter Morville / Louis Rosenfeld
(NLB Singapore | Amazon)

6. Designing Web Usability
Jakob Nielsen
(NLB Singapore | Amazon)

7. Modular Web Design
Nathan Curtis
(NLB Singapore | Amazon)

8. The Inmates are Running the Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity
Alan Cooper
(NLB Singapore | Amazon)

9. Observing the User Experience
Mike Kuniavsky
(NLB Singapore | Amazon)


If you know any others, or have any comments on the above, I'd love to know.

Linux recursively find and replace in files from command line using sed



find ./ -type f -exec sed -i 's/original_string/string_to_replace/' {} \;


As found on this page: http://www.jonasblog.com/search-and-replace-in-all-files-within-a-directory-recursively

Monday, November 26, 2012

Magento getShippingRatesCollection Methods



Magento: Show all shipping options for the item in your cart.

Because sometimes you might need to do this:

$quote = Mage::getSingleton('checkout/cart')->getQuote();
$rates = $quote->getShippingAddress()->getShippingRatesCollection();

foreach ($rates as $rate)
{
echo "
Shipping Method: " . $rate->getMethod();
echo "
Shipping Method Title: " . $rate->getMethodTitle();
echo "
Shipping Method Description: " . $rate-> getMethodDescription();
echo "
Shipping Price: " . $rate->getPrice();
echo "
Carrier: " . $rate-> getCarrier();
echo "
Carrier Title: " . $rate-> getCarrierTitle();
}

Tomcat WEB-INF on Ubuntu

Is here on my machine:

/var/lib/tomcat6/webapps/ROOT/WEB-INF

Sunday, November 25, 2012

Dynamic Canonical Links in PHP and RackSpace Cloud Issue with Google indexing "static.cloud-ips.com"


Using RackSpace cloud as a server is pretty sweet. One thing you need to look out for is Google indexing your server space from the "static.cloud-ips.com" reference rather than your domain name.

RackSpace suggest setting the canonical URL link, as do Google:
http://googlewebmastercentral.blogspot.sg/2009/02/specify-your-canonical.html



When you've already made a site with thousands of links this might be a bit of a problem. Never mind, here's a dynamic way of setting the canonical link in PHP:


Get Country Name from Magento Checkout/Billing Details

Like so: $checkout = Mage::getSingleton('checkout/session')->getQuote(); $billing_addr = $checkout->getBillingAddress(); $country_name = Mage::getModel('directory/country')->load($billing_addr->getCountryId())->getName(); echo $country_name;

Tuesday, November 20, 2012

Help Needed On Decision to Upgrade to a Mac Book Pro

I have an old MacBook from the 2007 era. At the risk of being labelled as a fan boy, I really really like it. I've pimped it out with a 7200rpm drive which I dug very very hard to find in Sim Lim Square, Singapore, and 4 gig of RAM which is about as pimped as it will allow me to. Don't ask me if I'm a Mac or a PC because my straight answer is that I'm more of a Commodore 64/ZX Spectrum and Atari ST520 guy. With its age, it does get me funny looks from the schoolkids doing their homework on much newer machines in the Coffee Bean & Tea Leaf where I spend my days coding and crafting up silly tech ideas.

In a few years time it will be awesome enough to be ironic but, like Georges St Pierre of the MMA, it has seen better days and is causing me problems in the departments of 1) MS Word crashing ever 10 minutes and 2) needing a fan/heatsink thing to sit underneath it. It does do me well, and it can run XCode as well as a bunch of other apps pretty smoothly (so long as the heat sink & fan are used underneath it).

Here's a picture of the beast in action with my 1Tb, Sonic the Hedgehog drive.




So here's what I'm thinking, I'm thinking that the new MacBooks are gonna be wayyyyy better than my current old beast which is almost six years old. That's ancient for Singapore standards.
On that note, I went to the lovely Apple website and found a shiny new entry level MBP for SGD$1688. I don't need the retina display since I use my laptop mainly plugged into an external LCD monitor. So it should be good enough for me.

Then I looked at the specs. Compared to my six year old MacBook there doesn't seem to be much of a difference. Worst still, the hard drive in the newer Mac is a 5400RPM one. Do 7200RPM drives not exist anymore? Here's how they compare:



So my question is: Should I bother upgrading to an entry level MBP and then pimp it out? Or is it not going to be worth the effort and just stick to plodding along with my trusty old MacBook and save up S$5000 for the monster of a 12 core desktop Mac? Apart from aesthetics, what will the benefits be if I change my current MacBook to a new MBP? How much better is the bus speed, hardware, etc in the new MBP? Is it gonna change my life and make me 10 times more productive?

Or should I just spend my money on coffee and more cooling apparatus for my workhorse?


Friday, November 16, 2012

javascript replace space

str = str.replace(" ", "-"); or, better: str = str.replace(/\s/g, "-");

Wednesday, November 14, 2012

Restart Apache on Mac

If I had a dollar for every time I forgot how to do this.

I'd have a lot of dollars.

How to restart Apache on a Mac:

sudo /usr/sbin/apachectl restart