Updated: jQuery Loan Calculator

So thanks to all you loyal followers and users, I have updated the code behind my Mortgage Calculator. I have allowed users to either calculate their loan based on months or years. Also I updated the page to 2014 standards.

Want to play with it? Check it out live:

http://joelvasallo.com/mortgage.html

As always, browse the source:
https://github.com/jvasallo/jquery-mortgage

Let me know what you think or report any bugs!

Credit Card Regex

After searching the internet for a credit card regex pattern, I found a lot of roundabout answers and no clear cut regex pattern. I aim to change that! Here is a regex pattern you can use to match credit cards (disclaimer: it may not work 100% for you but after a few tweaks I am sure it will!)

((?:(?:4\d{3})|(?:5[1-5]\d{2})|6(?:011|5[0-9]{2}))(?:-?|\040?)(?:\d{4}(?:-?|\040?)){3}|(?:3[4,7]\d{2})(?:-?|\040?)\d{6}(?:-?|\040?)\d{5})

If you have your own cool regex to share, post it in the comments! Hope this helps someone out there!

Updated: Must Have Mac Software (now + Hardware)!

So now that I have been using my Mac for almost 3 months now, I can honestly say it has been on of the best investments for me! I have revised or added to the list I previously created; especially since some of you are starting to get your first Mac as well! 🙂 Below you will find what I consider a must have for anyone doing serious development/enterprise level work. Feel free to share some more in the comments section!

  • Email: AirMail (http://airmailapp.com/)
  • IRC/Lync/Chat: Adium (https://adium.im/)
  • Terminal: iTerm2 (http://www.iterm2.com/)
  • Text Editor: Sublime Text2 (http://www.sublimetext.com/2)
  • Docs: Dash (http://kapeli.com/dash)
  • Snap Windows: BetterSnapTool (http://blog.boastr.net/)
  • Virtualization: VirtualBox (https://www.virtualbox.org/)
  • VNC: Chicken (http://sourceforge.net/projects/chicken/)
  • Remote Desktop: Windows Remote Desktop Client (https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417)
  • Quick Access: Alfred (http://www.alfredapp.com/) QuickSilver (http://qsapp.com/)
  • Go To Terminal from Finder: cd to (https://github.com/jbtule/cdto)
  • SCP/FTP: FileZilla (https://filezilla-project.org/download.php)
  • Archive Access: TheUnarchiver (http://wakaba.c3.cx/s/apps/unarchiver)
  • Python Dev: PyCharm (http://www.jetbrains.com/pycharm/)
  • Java Dev: IntelliJ (http://www.jetbrains.com/idea/)
  • Oracle DB: sqldeveloper (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html)
  • MySQL DB: MySQL Workbench (http://www.mysql.com/products/workbench/)
  • Package Manager: homebrew (http://brew.sh/)

Hardware:

  • Logitech Solar Keyboard (http://amzn.com/B005L38VRU) — Feels like the Mac keyboard and uses solar/artificial light to keep it charged! So long batteries!
  • Magic Trackpad (http://www.apple.com/magictrackpad/) — Once you invest in the track pad… I recommend ditching the mouse.
  • Moshi Palmguard (http://amzn.com/B009J90TR2) — I bought this cause my wrists would always smudge my Mac.
  • Klear Screen Cleaner Kit (http://amzn.com/B0023WU6OI) — Best screen cleaner although it has a funky smell when using it. Leaves my screen like new.
  • mStand Laptop Stand (http://amzn.com/B000OOYECC) — Amazing stand for the Mac. Solid aluminum and great build quality.
  • Unitek USB 3.0 and rj45 Hub (http://amzn.com/B00EHDNAOE) — Lets face it, we only get 2 USB ports and no wired connection. Pop this sucker in and you get both in a compact and portable device!
  • Official Mac Charger (http://amzn.com/B008ALAAV0) — Guys…buy a used one from Amazon. I saved myself close to $50 bucks buying a “used” one. Came in the box, like new. 🙂
  • Kuzy Black Case (http://amzn.com/B008AZYIKU) — Eh…take it or leave it. The bottom clips seem to have broken on mine, but overall for $20 bucks you can’t go wrong.

0129140037

jQuery + web2py Storefront! (now with Stripe.js)

So I have been getting a lot of feedback from people about my storefront page (thanks for that!) and decided to place the code on Github! The code features some enhancements to the live demo below, but I will try to see if I can sync up a demo for you all! I added drag and drop functionality, real-time search, and some simple back end processing as well (ready for server side handling of Stripe payments). Hope this helps some people get started! As always feel free to reach out to me if you have any questions! 🙂

Source Code — Github
Stripe.js
web2py

old LIVE DEMO

Installing cx_Oracle on a Mac

UPDATE: I have updated this article to reflect the state of cx_Oracle and MacOS in 2017!

Spoiler Alert: It is way easier and this guide should be considered outdated!

Installing cx_Oracle on a Mac: 2017 Edition

So as previously mentioned, I got a Macbook Pro. Nearly two months later, I am loving it more and more. The only gripe I had was installing a specific package called cx_Oracle; a Python Oracle DB connection package. After a lot of attempts, I finally got a working copy installed on my local machine. I noticed there are many tutorials around the web, but they are a bit outdated, I am on Mavericks, so I will create a nice article not only for you guys, but also for myself.

Necessary Downloads:

  1. cx_Oracle — Source Code Only Option — (http://cx-oracle.sourceforge.net/)
  2. Oracle Instant Client Basic 64-bit (http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html)
  3. Oracle Instant Client SDK 64-bit (http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html)

Next Steps:
Assuming you downloaded all the above files, and they are found in your Downloads directory, run the following commands as sudo:

sudo su
mkdir /Users/<username_here>/oracle
mv /Users/<username_here>/Downloads/instantclient-* /Users/<username_here>/oracle
cd /Users/<username_here>/oracle
unzip instantclient-basic-macos.x64-11.2.0.3.0.zip
unzip instantclient-sdk-macos.x64-11.2.0.3.0.zip
cd instantclient_11_2/sdk
unzip ottclasses.zip
cd ..
cp -R ./sdk/* .
cp -R ./sdk/include/* .
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
vim ~/.bash_profile

 

Add the following lines (you may want to add these lines to your own accounts .bash_profile too):
export ORACLE_HOME=/Users/<username_here>/oracle/instantclient_11_2
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME

 

Once you enter all the info, you should resource your bash_profile. After this, you setup instant client as well! I would validate all your settings are correct as well:

. ~/.bash_profile
echo $ORACLE_HOME # should be /Users/username_here/oracle/instantclient_11_2 if you followed this guide
echo $DYLD_LIBRARY_PATH # same as above
echo $LD_LIBRARY_PATH # same as above
which python # usually /usr/bin/python
which gcc # usually /usr/bin/gcc

If all of the above is set, then you are ready to proceed with the cx_Oracle Install!

. ~/.bash_profile
cd /Users/username_here/Downloads
tar -xzf cx_Oracle-5.1.2.tar.gz
cd cx_Oracle-5.1.2
sudo python setup.py build
sudo python setup.py install

If all went according to plan, it should have successfully installed! (if not post in the comments and I can help!) To test simply:

python
import cx_Oracle
# you may see some junk like:
/Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.9-intel.egg/cx_Oracle.py:3: UserWarning: Module cx_Oracle was already imported from /Library/Python/2.7/site-packages/cx_Oracle-5.1.2-py2.7-macosx-10.9-intel.egg/cx_Oracle.pyc, but /Users/username_here/Downloads/cx_Oracle-5.1.2 is being added to sys.path

Hope this helps someone out there! 😀

UPDATE:
Seems like Oracle made a change to the basic zip since this was posted, the step when you are setting up symlinks. If you used my guide previously and you did:

ln -s libclntsh.dylib.11.2 libclntsh.dylib
ln -s libocci.dylib.11.2 libocci.dylib

you should unlink your symlinks and this should be…

ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
I have updated the article since! 🙂
UPDATE 2:

William Smith, a commenter on the article, said he still ran into an error where Oracle software could not be found. He was able to get past the issue by using “sudo -E” with when installing:

$ sudo -E python setup.py install

The “-E” flag on sudo ensures that the local environment variables are preserved with root when the command is run. Thanks! Check out his full comment: http://joelvasallo.com/?p=276#comments

Ok Glass…

So I was recently invited to the Google Glass Explorer Program, and was super excited. I went ahead and ponied up the near ~$1600 and got my package nearly 2 days later. I had the glasses for about a week now, and they are something….unique. In some aspects, I am amazed, and in some aspects I am a bit let down. I want to give a formal review of my experience over the weekend and give my two week review. I will cover Hardware, Software, Usability, and Comfort. If you got any questions you want answered, comment below! I will leave you all with a picture:

Photo on 12-4-13 at 4.00 PM #3

A Break From The Norm

So it’s that time of year, we have to come and reflect what we are all thankful for. I want to take this time to thank so many people in my life…here it goes.

Thankful for all the blessings I had this year; graduated college, got my first job, been given good health. Even achieving one of those things is amazing, the fact that I did all those things (with the help and support of all my friends and family) is really a blessing. Just know that with y’alls support, I would be nothing. You all motivate me to get better and better, and you never fail to do so.

I am thankful for having the best coworkers in the world. Y’all mentored me, y’all took me under your wings as a novice intern. I hope that you have learned from me as the way I have learned from you. The fact that I enjoy waking up, going to work, and working with all you is an amazing thing. Not many people can say they love their job; but I am proud to say that I do thanks to all of you.

Next, I am thankful my sports crew. We play basketball, we play football, heck we even play softball. We lift together, we eat together. We play hard, and even though we may play hard on the court/field, off the field we are all friends. No hate, just love for the game and one another.

I am thankful for all the new friends I have made this year. It is always good to have good people in your life. I have meet some strong willed and inspiring people this year; ThinkChicago, DePaul Linux Community, Graduation, etc. Don’t ever change! 🙂

Next, I wanna be thankful for my concert crew. Lollapalooza? Riot Fest? NorthCoast? I try to make those festivals fun for y’all when we hang out, and you guys and gals do likewise; even though I do get a bit…rowdy hehe. Fun times! Let’s do it again 2014? 🙂

Finally, I am extremely thankful for all the close friends and family. You all know who you are; you guys/gals are always there for me even when I am at my lowest. I hope you all realize that I am there for you all too.

Happy Thanksgiving all! At the risk of sounding cheesy, “Money will come and go. The most important thing in life will always be the people you know. Salud, mi familia.”

Must Have Mac Software/Apps

So I have been enjoying my Mac experiment for about a month now, and so far so good! My biggest issue when it came to my Mac was making it feel like my previous Fedora laptop. Below you will find what I consider a must have for anyone doing serious development/enterprise level work. Feel free to share some more in the comments section!

  • Email: AirMail (http://airmailapp.com/)
  • IRC/Lync/Chat: Adium (https://adium.im/)
  • Terminal: iTerm2 (http://www.iterm2.com/)
  • Text Editor: Sublime Text2 (http://www.sublimetext.com/2)
  • Docs: Dash (http://kapeli.com/dash)
  • Snap Windows: BetterSnapTool (http://blog.boastr.net/)
  • Virtualization: VirtualBox (https://www.virtualbox.org/)
  • VNC: Chicken (http://sourceforge.net/projects/chicken/)
  • Remote Desktop: Windows Remote Desktop Client (https://itunes.apple.com/us/app/microsoft-remote-desktop/id715768417)
  • Quick Access: QuickSilver (http://qsapp.com/)
  • Go To Terminal from Finder: cd to (https://github.com/jbtule/cdto)
  • SCP/FTP: FileZilla (https://filezilla-project.org/download.php)
  • Archive Access: TheUnarchiver (http://wakaba.c3.cx/s/apps/unarchiver)
  • Python Dev: PyCharm (http://www.jetbrains.com/pycharm/)
  • Oracle DB: sqldeveloper (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html)
  • MySQL DB: MySQL Workbench (http://www.mysql.com/products/workbench/)
  • Package Manager: homebrew (http://brew.sh/)

Mac-ing my Mac: Show me the Packages

Another article on this topic and I hope it is helping someone else out there! So when using Linux, my favorite thing was being able to simply say “yum install .” Fortunately, I was aware of a custom package manager known as Brew. Very cool and easy to install; so easy it all installed with one command in the terminal!

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install wget
brew install vim
brew install git

Source: http://brew.sh/

Mac-ing the Mac: Fix my Terminal!

So I recently got a brand new Macbook Pro for Work, but I am coming from a Fedora Machine; which to be honest may seem almost like a downgrade at this point. One thing I noticed is that I hated the look and feel of the stock Mac terminal. It felt really cluttered and at times cumbersome. To make your Mac more like Fedora’s bash do the following:

1) Make a backup of your existing .bash_profile

mv ~/.bash_profile ~/.bash_profile.bak

2) Open a new ~/.bash_profile and enter:

#!/bin/bash
export PS1="[\u@\h \W]$ "
alias ls="ls -G"
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"

3) Optional – Edit your root accounts bash profile as well to have a # instead of the $ (useful to prevent cumbersome mistakes)

#!/bin/bash
export PS1="[\u@\h \W]# "
alias ls="ls -G"
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"

Also add this to your .profile:

if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi

Thanks to OSX Daily for the post!
http://osxdaily.com/2006/12/11/how-to-customize-your-terminal-prompt/