Skip to content

Instantly share code, notes, and snippets.

@rmatil
rmatil / moveReadLogglyMailsToArchive.gs
Created January 3, 2018 15:24
Archive read emails from a particular Label
function moveReadLogglyMailsToArchive() {
// Get all inbox emails (the label is applied by a filter matching all incoming conversations)
var label = GmailApp.getUserLabelByName("[Loggly Autoarchiver] Inbox");
if (label === null || label === undefined) {
// abort
return -1;
}
var threads = label.getThreads();
@rmatil
rmatil / gist:4bc690f3884638c427c9
Last active October 27, 2018 03:00
Puphpet, Vagrant, PHPStorm and Xdebug

Setup Xdebug for PHPStorm on vagrant using PHP

Create Virtual Machine

Go to PUPHPET and create your VM. Check Install Xdebug on step 4 (Languages > PHP).

Configure Xdebug on the VM

First check that everything went right while provisioning your VM: Create a new file named info.php and put the following code in it:

#/usr/bin/php
@rmatil
rmatil / gist:8d21620c11039a442964
Created March 25, 2015 13:39
Connect MySQL database in Vagrant VM from Host machine

Connecting to Vagrant VM MySQL database from host

This gist shows how to connect to your vagrant MySQL database from the host machine.

Change Address Binding from MySQL

  • Connect to vagrant using vagrant ssh
  • Edit file /etc/mysql/my.cnf:
    • Change parameter bind-address to 0.0.0.0 to allow all incoming connection attempts
@rmatil
rmatil / gist:787b424f9bd2098dc794
Last active August 29, 2015 14:15
Setup Vagrant for local development with PHP and multiple Vhosts

Generate Vagrantfile

Visit https://puphpet.com/ and build the local development environment. Download the generated Vagrantfile and the corresponding puphet directory and move it to your Document Root.

Note: Use web folder for Document Root on projects which provide it.

Set up local environment