Skip to content

Instantly share code, notes, and snippets.

View LTroya's full-sized avatar

Luis Troya LTroya

  • Santiago, Chile
View GitHub Profile
@nasrulhazim
nasrulhazim / readme.md
Last active September 3, 2018 04:45
Using Middleware to Check Account Activation and Resend Activation E-mail
@Richzendy
Richzendy / Reglas_Principales_para_entrar_al_mundo_de_Wordpress.md
Last active February 28, 2020 13:11
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: https://premium.wpmudev.org/blog/wordpress-dictionary/
  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 https://developer.wordpress.org/themes/basics/template-hierarchy/
  4. Si vas a codear plugins o templates para WP, revisa la API, hay cientos de funciones ya hechas https://codex.wordpress.org/WordPress_APIs por ejemplo, ya WP tiene un sistema de manejo de llamadas AJAX built in ( https://codex.wordpress.org/AJAX_in_Plugins) y un ejemplo más didáctico del uso de AJAX dentro de WP lo puedes encontrar por acá https://premium.wpmudev.org/blog/using-ajax-with-wordpress/
  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
khanhtran3005 / php - nodejs
Last active September 14, 2021 04:14
Share session between PHP and NodeJS
http://stackoverflow.com/questions/24296212/php-nodejs-and-sessions#24303059
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.
Assumptions
@calebporzio
calebporzio / tinker_helper.php
Created January 30, 2019 23:56
A quick, memorable way to initiate an "artisan tinker" session and play with variables.
<?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.
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 2, 2024 18:45
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

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