Skip to content

Instantly share code, notes, and snippets.


Luis Troya LTroya

  • Santiago, Chile
View GitHub Profile
calebporzio / tinker_helper.php
Created Jan 30, 2019
A quick, memorable way to initiate an "artisan tinker" session and play with variables.
View tinker_helper.php
function tinker(...$args) {
// Because there is no way of knowing what variable names
// the caller of this function used with the php run-time,
// we have to get clever. My solution is to peek at the
// stack trace, open up the file that called "tinker()"
// and parse out any variable names, so I can load
// them in the tinker shell and preserve their names.
nasrulhazim /
Last active Sep 3, 2018
Using Middleware to Check Account Activation and Resend Activation E-mail
Richzendy /
Last active Feb 28, 2020
Reglas Principales para entrar al mundo de Wordpress
  1. Empieza por leer (lo siento, está en inglés) el diccionario de terminología WordPress de la A-Z:
  2. Antes de codear algo en WP, busca un plugin o tema, hay miles de ellos, si no sabes cual usar, pregunta.
  3. Si vas a codear o modificar templates, aprende "Child Themes" y la jerarquia de ejecución
  4. Si vas a codear plugins o templates para WP, revisa la API, hay cientos de funciones ya hechas por ejemplo, ya WP tiene un sistema de manejo de llamadas AJAX built in ( y un ejemplo más didáctico del uso de AJAX dentro de WP lo puedes encontrar por acá
  5. WP parece sencillo y en su estado puro no parece la gran cosa pero puede ser extendido fácilmente, aprende de "custom posts" y "custom fields" para personalizarlo ( advanced custom fields es un
khanhtran3005 / php - nodejs
Last active Sep 14, 2021
Share session between PHP and NodeJS
View php - nodejs
You can use memcached as your session storage handler in PHP. Memcached is a simple key value store that can be accessed via TCP; there is a memcached module available for Node.js.
PHP stores the session in memcached by using the session id as the key. The session data (value) stored in memcached is a serialized PHP object, with a slight twist. You can read more about this unusual serialization at the SO question "Parse PHP Session in Javascript". Luckily though, there is already an NPM module out there: php-unserialize.
Now for the How-To.
irazasyed / Install Composer using MAMP's
Last active Oct 4, 2022
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management
View Install Composer using MAMP's

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management

Instructions to Change PHP Installation

First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php