78IYQCw

Customize Google Maps

Custom styles for google maps:
https://snazzymaps.com/about

Snazzy Maps is a community built around creating great looking styles for Google Maps.

As of version 3 of the Google Maps API custom styles can now be applied to maps. This allows developers and designers to pick a style that matches the theme of their website.

We love great resources that make web development easier and this is our way to give back to the community. Like any great resource it depends on great content. All styles on the site are created by our awesome users and shared free of charge.

All styles are licensed under creative commons and are completely free to use.

Snazzy Maps is an Atmist product and was created in Edmonton, Alberta, Canada. Feel free to contact us at support@snazzymaps.com or leave us some feedback on our UserVoice page.

Read More

programmatically add wpml string translation

First we need to register the string on wpml translation table.

The above function will return a string_id and we will need this id for icl_add_string_translation() function to add labels for other languages.

Alternatively, we can use icl_get_string_id() to get the string_id as:

Read More

How to Set an Expires Header in Apache

Enalbe mod_expires on server
LoadModule expires_module modules/mod_expires.so

Read More

present a pdf file for download via PHP after checking some rules

First we create a rule on htaccess and redirect the pdf files to a php with its path as query string

The sample code for the pdf-viewer.php.

Read More

Remove illegal characters from files during uploading on wordpress

wp_handle_upload_prefilter allows user to change the files during uploads.
http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_handle_upload_prefilter

ex.

Read More

What is the difference between inversedBy and mappedBy on Doctrine?

  • mappedBy has to be specified on the inversed side of a (bidirectional) association
  • inversedBy has to be specified on the owning side of a (bidirectional) association

from doctrine documentation:

  • ManyToOne is always the owning side of a bidirectional assocation.
  • OneToMany is always the inverse side of a bidirectional assocation.
  • The owning side of a OneToOne assocation is the entity with the table containing the foreign key.

doctrine documentation:
http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html

Read More