Ignore File Changes without using .gitignore

I am taking a note regarding this way of ignoring file changes just encase you guys bump in to the situation where the file is not included to your .gitignore file and you want to keep it track later on.

This will tell git you want to start ignoring the changes to the file
git update-index  ––assume-unchanged path/to/file
(This command will assume that there is no changes to the specified file , so no need to worry if you’ll accidentally committed its changes)

When you want to start keeping track again
git update-index ––no-assume-unchanged path/to/file


Avoid app from crashing during the loop – C#

I was new on C#.Net when i tried to create an app for scraping websites. At first i am using a single thread to handle loop logic which causes the app to crash several times if it involves a huge amount of data and leave all activity on foreground.

C# has background worker which can help avoid system crashes and more resource wise.

check this simple code , this shows how background workers being used

Laravel 404

From your web development using Laravel you may experience this issue as you setup a fresh web application run by apache and using virtual host for your http configurations. Defined routes doesn’t work but you think you set it right. On your virtual host configuration (.conf file) you put

AllowOverride All

but still you are getting a 404 error

the solution is, be sure to enable mod_rewrite


sudo a2enmod rewrite

then restart your apache

sudo service apache2 restart

This should fix the issue

Note: This is on linux implemetation

I experienced this issue when i tried to setup AsgardCMS (a laravel CMS) on a fresh/new server, took me a long time to discover the issue that’s why i am posting this note just encase.


Using Google Sheet as Database

One way to show the data to your client with read only(depends on you) access accessible through web/mobile without creating new interface. Google Sheet is one of the solutions you can pick. Google sheet provides security features, history etc.. which make stuffs easier.

Using GSHEET as a DB is probably not a good idea. This is just an experiment (You might lose your hair)

On this article I will teach you how to Integrate Google Sheet as your database with PHP engine. LET’S GET STARTED!

We need Google Developer Console Account for this

  1. On your google developer console account create a new project , name it whatever you want 😉 .
  2. Once it is successfully created. Click on credentials , then create credentials. Select service account key  cc
  3. Then you will be redirected to this page(see image below).
  4.  On service account select New service then fill out Service account name(input whatever service name you want). Choose P12 as Key type
  5. Then hit Create!
  6. After it is created .p12 file should be automatically downloaded(example file: whateveryouwant-2.p12 – dont lose this file we will gonna use this for Google Service API)  and pop out look like this(see image below). Note on the private key “notasecret” we will be using this one later. (BTW You can hit close)pop
  7. After closing the modal you will be Service Accounts page.sap Please note on the service account ID from the service account we created. It’s an email address format right? This we will use this email address later.
  8. Next step is to create your own GOOGLE SHEET (now here we go setting up our DB).
  9. Done creating your own GOOGLE SHEET?
  10.  Hold up! dont close the sheet. Click on share.
  11.  Now share it to the service account we created on step #7. (Input the service account ID in this case whateveryouwant@whateveryouwant.iam.gserviceaccount.com)INTEGRATING the connection with PHP using google service API will be in  my next article 😉

ZMQ on Xampp

I have an app run by laravel and experienced this error when i run composer install command from CLI.

Problem 1
 - Installation request for react/zmq v0.3.0 -> satisfiable by react/zmq[v0.3.0].
 - react/zmq v0.3.0 requires ext-zmq * -> the requested PHP extension zmq is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
 - C:\xampp\php\php.ini
 You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Here are some awesome ways to deal with that issue.
1.  Download all dll here http://pecl.php.net/package/zmq to your matching OS.
Make sure you got the right one (x86 or x64) and that it is either thread safe or non-      thread safe. How would you know? Time to play DLL roulette.
2. Copy libzmq.dll to your ~/xampp/php/
3. Copy php_zmq.dll to your php extension directory (eg. ~/xampp/php/ext/)
4. Then add this to your php.ini extension=php_zmq.dll


Javascript search item from an array of objects

Using jquery grep to search an object from an array with a value of a specific key.

For example searching like mysql 'like'
var restaurants [{id:1, restname: 'Cafe Namo'},{id:2,restname:'TefeCool'},{id:3,restname:'Ivans Resto'}];

var query_string = 'fe';

$.grep(restaurants, function (e) {
 var search = new RegExp(query_string, "i");
 return search.test(e.restname);

Return value is
[{id:1, restname: 'Cafe Namo'},{id:2,restname:'TefeCool'}]

Google Maps Address Interaction(postcode) using

I am using jquery, html5 for this example.


Load the google maps api link


This will be the container of the google maps Note: Set height for your google map container.


var map;

var geocoder;

//This function intialize the google maps settings

function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var mapOptions = {
        zoom: 16, center: latlng, disableDoubleClickZoom: true
    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

//This function sets the address for the google map
function codeAddress(address) {
    geocoder.geocode({'address': address}, function (results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location

//now its time to load the google maps


     codeAddress('600'); //set default postcode