snippet - Load a file by uri in Drupal 7
16 May, 2018
This snippet shows you how to load a file by uri. Basically this option is available with file_load_mulitple only.
snippet - MySQL: insert/update multiple rows with a single query
16 May, 2018
To insert multiple rows with a single query you can use regular insert with multiple value rows. You can also use update if you have primary key set.
snippet - Import csv to MySQL FAST
16 May, 2018
Import csv file to MySQL, the fastest way is to use a direct import with query. You have to have the columns created the way you need.
snippet - MySQL export query as csv directly
8 May, 2018
Example query for direct csv saving from mysql. Using query to import or export data is the fastest method. You can export your query results as csv with custom syntax. You have to use union to join...
snippet - Field group alter to add html in Drupal 7
4 May, 2018
Field group lets you do some amazing forms. Still when you have empty element or the form just is too long and needs some custom modifications, you can then use prefix and suffix from form api to...
snippet - Delete all terms from all vocabularies in Drupal 7
26 Mar, 2018
Delete all terms from all vocabularies in Drupal 7. This is ran by Drush, but you can run it from wherever Drupal is initialised.
snippet - PHP: http request function, alternative to curl or file_get_contents
12 Mar, 2018
Handles any HTTP request correctly. This is a flexible and powerful HTTP client implementation of GET, POST, PUT or any other HTTP requests. The reason I built this was due to use of url arguments...
snippet - Remove Docker containers, for already exists error
26 Mar, 2018
Easy fix for an error "ERROR: for [CONTAINER_NAME] Cannot start service mailhog: container "[CONTAINER_ID]": already exists.". This is the quick fix, the to problem. To find out what went wrong with...
snippet - Drupal 7 commerce add product variation types programmatically
12 Mar, 2018
Example for how to create product variation types programmatically.
17 Feb, 2018
The problem is how you can block channels to protect your child on the phone, ps4 or computer. Most YouTube channel blocking guides include some kind of extensions or plainly say it's not possible....