Easy orientation change detection for Ionic Apps or mobile web apps.

    function() {
        if (window.orientation == 90 || window.orientation == -90) {
            alert('landscape mode');
        } else {
            alert('portrait mode;);
    }, false);

Of course you should go to University and study whatever you want. Of course you should find your passion, however long it takes. You can be whatever you want. You can do whatever you want. Post secondary education is an investment in your future.

But maybe spending $100,000 and eight-years of your life on that double-major in history and fine arts, only to spend the next few years working as a Starbucks barista, wasn’t the wisest use of your time and money.

Of Course, But Maybe…

DIY can be seen as a side-hustle to make more money. Now there’s zero excuse for folks who are unwilling to moonlight, start a side business, or create a product to generate passive income. You can simply increase the amount of DIY projects, like cleaning, to earn more money by saving money.

If you love money, you will probably be better at accumulating more money. You’ll do a lot more research on how wealthy people got rich, what to invest in the stock market, how to get a raise, and all sorts of money attracting stuff.

It’s OK to Love Money

If you’ve ever had a big idea and thought, “There’s no way I can make time for it,” there are a lot of real-life stories that say, “Yes, you can.”

Craigslist, Spankx, GitHub, Basecamp were all side projects. Wake up earlier or sleep later. You have to prioritize what’s important.

The Craigslist Method

Put this one liner in terminal to stop Android File Transfer from autostarting on OSX whenever you plug in your Android device.

PID=$(ps -fe | grep "[A]ndroid File Transfer Agent" | awk '{print $2}'); if [[ -n $PID ]]; then kill $PID; fi; mv "/Applications/Android File Transfer.app/Contents/Resources/Android File Transfer Agent.app" "/Applications/Android File Transfer.app/Contents/Resources/Android File Transfer Agent DISABLED.app"; mv "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent.app" "${HOME}/Library/Application Support/Google/Android File Transfer/Android File Transfer Agent DISABLED.app"; osascript -e 'tell application "System Events" to delete every login item whose name is "Android File Transfer Agent"'

Credit goes to monkeyhybrid

Since ‘brew bundle’ has been deprecated, here is a temporary fix.

Create a file named brew-bundle and write the code below.

#!/usr/bin/env sh
[ -f "Brewfile" ] || (echo "No Brewfile found" 1>&2 && exit -1)
while read line
  [ "${line###*}" ] && brew $line
done < Brewfile

Place file in ~/bin/ and chmod +x ~/bin/brew-bundle

You’re now able to use your Brewfile again.

I have just read The 4-Hour Workweek by Tim Ferris. Great book on lifestyle automation.
Here’s some notes I took on the book while reading.

– Limit tasks to the important to shorten work time (80/20 rule)
– Shorten work time to limit tasks to the tasks to the important (Parkinson’s Law)
Using a shorter deadline will force you to focus on execution.
Identifying the critical tasks and scheduling them with very short and clear deadlines is the best solution for becoming productive and efficient.

Ask yourself:
– Am I being productive or just active?
– Am I inventing things to do to avoid the important?

Compile a todo list that is not computerized for the next day. There should be never more than 2 items to complete each day. If there is, you must ask yourself “If this is the only thing I accomplish, will I be satisfied with today?”

Propose solutions to everyday questions, instead of asking for opinions.

I. Low information diet
A. Selective ignorance
i. Problems solve themselves or disappear if you remove yourself as a bottleneck and empower others.
ii. Increased output demands decreased input.
B. Actions
i. One week information fast; no news, no television, no unnecessary web browsing.
ii. Catch up news by asking colleagues
iii. Information should be used immediately and stored if it is important.
iv. Focus on “on-time” information and not “just-in-case”
C. Challenge
i. Ask random strangers for their number. The goal is to get out of your comfort zone.
II. Interrupting Interruptions and the Art of Refusal
A. Assertiveness
i. Learn to be difficult when it matters.
ii. Having a reputation for being assertive will give you preferential treatment.
B. Time wasters
i. It is your job to train those around you to be effective and efficient.
ii. Keep meetings less than 30 minutes, and have defined goals and objectives.
C. Time consumers: batch and do not falter
i. Batch same types of tasks together.
ii. Estimate the the value of your time and the amount of time you save by batching tasks.
iii. Calculate how much you earn by multiplying the amount of time saved by your per hour rate for different batching frequencies: 1 time per week, two weeks, month.
iv. If problems creating by batching tasks together cost more than the hours saved, scale back to less frequent schedule.
D. Empowerment Failures: Rules and readjustment.
i. Try not to micromanage.
ii. People are smarter than you think. Give them a chance to prove themselves.
iii. Empower others to act without interrupting you. Give them permission.
iv. Set rules in your favor. Limit access to your time.
III. Income Automation
A. The Renaissance Minimalist
i. Cash flow and times, without these two things, nothing is possible.
ii. The more resellers there are, the fast your product goes extinct.
iii. The more middlemen are involved, the higher your margins need to be.
B. Begin with the end in mind.
i. Find a market, define customers, then find/develop a product for them.
ii. Aim for a 8-10x markup
iii. Price range of $50-200 per sale provides most profit for the last customer service hassle.
iv. Should take no more than 3-4 weeks to manufacture
v. Options: Resell a product, license a product, create a product
C. Credibility snowball
i. Join two or three related trade organizations
ii. read the three top selling books
iii. give one free one-to-three hour seminar.
iv. offer to write one or two articles for trade magazines.
D. Art of Undecision
i. Fewer Options = More revenue
ii. Customer service is providing excellent product at reputable price and solving legitimate problems in the fastest manner possible.
iii. The more options, the more indecision created and fewer orders received.
iv. The more options, the more manufacturing and customer service is needed.
a. offer one or two purchase options.
b. do not offer multiple shipping options, offer one fast method and charge premium.
c. eliminate phone orders and direct to online ordering.
d. do not offer international shipments.
v. Policies towards low maintenance customers and attracting high profit.
a. Do not accept via western union, checks or money orders.
b. raise wholesale minimums to 12-100 units and require tax id number.
c. refer all potential resellers to an online form.
d. never negotiate pricing or approve lower pricing for higher volume orders, cite company policy.
e. offer low priced products instead of free products to capture information for follow up sales.
f. offer a lose-win guarantee.
g. Do not accept orders from common mail fraud countries.
IV. How to look Fortune 500 in 45 minutes.
A. Don’t be the CEO or Founder.
i. give yourself a mid level vp. For negotiation purposes, do not appear to be the ultimate decision maker.
B. Put multiple email contacts on the website.
C. Set up an interactive voice response remote receptionist.
D. do not provide home address

I just finished Mark Cuban’s book How to Win at the Sport of Business: If I Can Do It, You Can Do It . It is an absolute buy at $2.99 for the Kindle.

The book was inspiring and included great lessons that an entrepreneur should learn.

  • The best skill in life is selling. Learn to sell, you are always selling when you own a business. Don’t sell your product, sell the solution to their problem.
  • Customers will work with you if you have other customers.
  • Business is a competition that is 7 x 24 x 365 forever.
  • “Going to college should be about experiencing as much academically as you possibly can, but more importantly, it should be about learning how to learn and recognizing that learning is a lifelong endeavor. School isn’t the end of the learning process, it’s purely a training ground and beginning.
  • “All that matters in business is that you get it right once. Then everyone can tell you how lucky you are.”
  • “Everyone has got the will to win; it’s only those with the will to prepare that do win.”
  • One thing we can all control is effort. Put in the time to become an expert in whatever you’re doing. It will give you an advantage because most people don’t do this.

Found a bug in the .has-feedback icon alignment in bootstrap 3. Add the following to your css file to fix it.

.has-feedback .form-control-feedback {
    position: absolute;
    top: 3px;
    right: 15px;
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;

Nearly all startups follow the same set of steps you see in the infographic below, created by Funders and Founders. The infographic shows the steps you usually have to take when making billions from a startup.