tag:blogger.com,1999:blog-11370058306543666832024-02-22T18:25:09.880+08:00ajibanda++..musings on programming and web developingAJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.comBlogger267125tag:blogger.com,1999:blog-1137005830654366683.post-90689408438797870912017-05-25T13:56:00.002+08:002017-05-25T14:11:28.609+08:00How to Embed PDF from Google Drive
Here's a guide on how to display a PDF uploaded from Google Drive to a HTML page using iframe
Steps:Make sure that your PDF is uploaded properly and all the priveleges are set up as well. Note that files' access in a Google Drive can be configured.
Right-click on the file and select Preview
Click the three dots on the upper right and select Open New Window
This will open the file AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-45110094138970122292017-05-10T11:53:00.001+08:002017-05-12T17:08:37.670+08:00[Solution] An error occurred while installing eventmachine and mysql gemThis post is for documenting two gem installation issues I got when reinstalling an old project. Running bundle update results to two issues on gem:
mysql (2.9.1)
eventmachine (1.0.3)
NoteAgain, this is an old installation of rails gems. Chances are these issues might have been resolved by newer versions, though based on experience, this gem errors are very common.
The most usual reason why theAJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-46549994639018657752016-07-23T16:09:00.000+08:002016-07-27T12:20:36.595+08:00An Old Stupid 'Kill the Spider' Game using PhonegapI was digging my old codes when I found this APK I did in 2014. It was a my first trial for a mobile game using Phonegap. Basically, it's a smash that stupid spider game I created out of nowhere in the event of testing whether it would be easy to create a game using Phonegap.
Again I said that this is a stupid game I created years ago... You have been warned!
A picture of Aragog in Harry PotterAJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-88072641521272674302016-07-10T22:21:00.002+08:002016-07-10T22:39:57.493+08:00Capturing Webcam Image For Uploading with Carrierwave and CropboxThe goal of this tutorial is to capture the image from the web cam and be able to upload it as if you are uploading an image in your Ruby on Rails project.
Before starting, it is assumed that you already have a working application that uses carrierwave (and so the set-up for it will not be mentioned here). Also, this may be considered as a continuation of the process stated on this article.
AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-52073291072718554102016-01-03T15:02:00.000+08:002016-01-03T15:02:29.015+08:00A Documentation of My Ruby on Rails Installation in Windows 10This is just a documentation of how I did a fresh install of Ruby on Rails on a Windows 10 (64-bit) system. If there is a faster way of doing this, *oh God*, please tell me.
Issue on installing versions of Ruby
In an Unix based system, I usually use RVM for version management. But I had an issue using this on Windows as it needs commands that are linux based. Installing cygwin didn't gave AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-80021283706228014842016-01-02T11:34:00.000+08:002016-01-02T11:34:43.605+08:00Running Multiple Version of Ruby on Windows with PikCurrently, I have to work on a Windows (specifically, Windows 10) system for two Ruby on Rails projects with different version. Also, the said system is fresh and there wasn't any existing rails installed yet.
Previous EncounterPreviously, I use InstantRails for Windows installment but, correct me if I am wrong, this method is long gone supported and isn't used anymore.
So what I'm after right AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-17689007148682498552015-03-22T19:00:00.000+08:002017-05-16T11:05:05.183+08:00How to Replace a Broken Image with a Default OneThere are cases in web designing wherein the image that you are placing are either unreachable or non-existing. This usually happens when image links that are hosted externally are dead or when images' src attribute are set to an invalid location.
For this cases, it would be best to replace an image with a default one. Here is a snippet for these matters:
(Note that we are using JQuery here, AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-39840420842377913642015-03-20T19:00:00.000+08:002015-04-04T17:02:50.641+08:00Append Share Links on Blockquote Blocks Using JQueryThis snippet is used to append a share link, specifically Twitter and Facebook links, on a blockquote to share the text inside it.
See live sample
Before StartingMake sure first that you have the following:
Facebook Developer App ID - For sharing in Facebook
Bit.ly API Key - For shortening the URL which is good for Twitter
JQuery
The Snippet// Get the current URL and strip all unnecessary AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-15966843681932643402015-03-19T13:40:00.001+08:002015-04-04T17:07:40.743+08:00Three Ways of Sending Emails with LaravelThis is just to document the methods I tried on sending emails with Laravel.
All of the mentioned methods work during the development stage. It was my limited access to the hosting server during the production that made me try this different approach.
Note that I've done this with Laravel 4. We'll be using three approach here on sending emails: Gmail, Mandrillapp and the default sendmail.
AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-64456477332267556652015-02-11T20:00:00.000+08:002015-04-04T17:16:20.652+08:00Cropping Image in Rails via Carrierwave and CropboxThis article aims to provide a method of cropping images to the desired scale and uploading it via gem in Ruby on Rails
SpecificationsAs of this writing, the following versions and code are used:
Ruby (1.9.2) and Rails (3.2)
Carrierwave (via gem, 0.9.0)
Cropbox
Scope and LimitationsThis post will provide steps on using Cropbox with Carrierwave only. Which means, that by following the steps, AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-70536437971182336752014-12-12T15:30:00.000+08:002015-04-04T17:19:53.393+08:00Error 404 for PHPMyAdmin Upon Updating PHP in LocalhostI've just updated my PHP version from 5.4 to 5.5. During the process, Apache and other files were updated too leaving some of my settings broken.
One of the first thing I checked after updating is my local database using PHPMyAdmin. Unfortunately typing localhost/phpmyadmin doesn't work anymore.
In order to resolve it, I added the code below to apache2.conf and restarted it:
#include AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-69221808997521594932014-12-07T17:35:00.000+08:002015-04-04T17:25:14.881+08:00Query for Finding Duplicates in an SQL TableMost of the time you'll encounter cases wherein you'll need to extract the entries on your database for duplicates. In that case, here is a query.
SELECT * FROM [TABLE_NAME]
GROUP BY [COLUMN_TO_CHECK] HAVING (COUNT([COLUMN_TO_CHECK]) > 1)
Assumed that you have a table called users and you'll extract items with same the same email address (if for some weird reason that you didn't include AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-17072124743749463462014-12-03T10:04:00.000+08:002015-04-04T17:25:44.558+08:00Unable to execute dex: Multiple dex files define Lcom/squareup/okhttp/AddressThe error occurs upon building a (on my case, it's PhoneGap) project running on Eclipse. This is caused of having two *.jar files inside the bin/dexedLibs directory. These files are generated every time you build your application.
Usually, multiple dex files error tells you that you are including the same class file from different sources.
SolutionTo resolve this, simply do the following:
AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-49808925950291502292014-11-10T20:00:00.000+08:002015-04-04T17:27:30.845+08:00Protecting Your Website From SniffersSecuring your site is one of the most important thing to note when creating and managing your own website. What most people do is to use SSL certificates to apply encryption for their website processes. But the question is, are they really secured?
One of the things I've managed for the past few days was to made sure that one of the website we created was really secured even though we used SSL AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-57577697814525185182014-10-19T23:26:00.002+08:002015-04-04T17:31:13.324+08:00Defining Scope for Validation in Laravel 4Coming from a Rails background for an MVC framework, one of the most common things to look for is a validation method for most of your inputs to avoid problems with your data later on. A good example is a uniqueness validation commonly used on usernames and email addresses.
In ROR, we can simply add the command for uniqueness in the model by this:
validate_uniqueness_of :usernameautomatically, AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-41007742918652389342014-10-05T22:43:00.000+08:002015-04-04T17:56:36.817+08:00Laravel Error - SQLSTATE[42S22]: Column not found: 1054 Unknown column 'remember_token' in 'field list'The way I understand Laravel 4, every time you log out, using the Auth namespace, the function will then update the record of the Users table specifically the updated_at and remember_token attributes.
But then, what if the remember_token doesn't exists? Then logging out would return the following error.
SQLSTATE[42S22]:Column not found:1054 Unknown column 'remember_token' in 'field list'
How I AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-61496632705240616722014-08-12T11:39:00.000+08:002015-04-04T18:03:45.012+08:00Creating an Ubuntu 12.04 FTP Server in Microsoft AzureAzure is a cloud platform provided by Microsoft. With this, you can create a Virtual Machine that can be used as a server for sending and accepting files.
Lately, I had a need to use the said cloud platform for my data storage being thrown via FTP. It wasn't that easy so I thought of having a step by step guide of doing it.
Therefore, in this post, I'll list the steps of setting up an Ubuntu AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-54573388545314771152014-04-29T22:22:00.000+08:002014-06-10T21:47:31.403+08:00Top 5 Ravishing Game Websites of 2014When a developer works on a soon-to-be blockbuster game, there's more to focus on than just the game itself. While not so long ago a simple game announcements was pretty much all the gamers got before the game was launched, things have dramatically changed, with game websites being created months before the game is actually released. Game websites are the perfect marketing tools, allowing the AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-54030211382868205512014-03-07T12:10:00.000+08:002014-06-10T22:09:00.060+08:00How is the approach to mobile app design going to evolve in 2014?Mobile apps have exploded on the market over the past two years. Revenues in this sector jumped sky high from $164 million dollars in 2012, to an astounding $1.88 billion in 2013. That's an increase of over a thousand percent, and it's not done yet. The market has taken notice, as shown by the recent IPO of King, creator of the popular Facebook game "Candy Crush Saga".
This lucrative businessAJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-17060881787175602772013-12-05T13:35:00.000+08:002014-06-10T22:00:10.010+08:00Most Creative and Addictive HTML5 gamesHTML 5 is becoming an excellent platform for game development. The recent years have been great for HTML5 from both a customer and a developer's perspective. Most browsing platforms have matured as far as the technology demanded by games is concerned. What's even more fascinating is that together with JavaScript, HTML5 can be a ground-breaking gaming platform. Nowadays, we can create fancy 2D AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com2tag:blogger.com,1999:blog-1137005830654366683.post-20161835228553075922013-12-04T11:48:00.000+08:002014-06-22T16:30:56.033+08:00Gaming Websites with Responsive DesignsResponsive web design went mainstream back in 2012, when increasingly more websites finally realized a practical menu and properly implemented social media tools work better than fancy graphics brought to extremes. Responsive web design is a loom that highlights the way development and design should respond to user behavior based on orientation, screen size, and platform. It’s more like a blend AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-87027970933483282662013-11-25T10:07:00.000+08:002014-07-12T19:13:22.687+08:005 Ways to Protect Your Website from CybercrimeSecurity giant Norton reported that 431 million adults in 24 countries experienced cybercrime in 2012, with losses totaling $388 billion. As a website owner, preventing cybercrime protects your business data, preserves your reputation and generates customer goodwill. Adopt these 5 practices to begin securing your website from cyber threats:
Shop around when choosing a web host - Web hosts AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-71938512622646833072013-11-07T11:05:00.000+08:002014-12-03T10:07:16.894+08:00'kill': Invalid argument (Errno::EINVAL) -- Troubleshoot Rails on DevelopmentProblemRunning a rails s on my app causes an error ...rack/server.rb:340:in 'kill': Invalid argument (Errno::EINVAL). This automatically stops the app from working.
I'm using InstantRails and running rails 3.2.13 on WEBrick for development, unfortunately it doesn't seem tow work for this specific app. The exact error is as listed below:
D:\rails_apps\********>rails s
=> Booting WEBrick
=&AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0tag:blogger.com,1999:blog-1137005830654366683.post-15058762157764206642013-10-28T00:27:00.000+08:002013-10-28T00:27:35.363+08:00The Programmer and His ClientThere are times that a programmer needs to interact with the client requesting for his service. Through that, the programmer receives first-hand information and may have a chance to ask directly the things that are a little unclear.
But is it really that helpful?
The Way I ThinkUsually, the moment you offer the programmer a problem that you want to solve, he already visualizes and formulates a AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com1tag:blogger.com,1999:blog-1137005830654366683.post-42933869778005376202013-10-21T09:39:00.000+08:002014-07-12T19:21:05.623+08:00Unique and Creative Video Game Website Designs EverGamers want to enjoy more than just an online experience. They want to know what the game has to offer, who has created the game, how skilled the video game company is, and what’s the real story behind the idea. These things bring gaming to a whole new level.
A fabulous video game will always come with an inspired video game webpage. And that’s a feature that can make or break a game. The AJ Bandahttp://www.blogger.com/profile/08761891733756852643noreply@blogger.com0