Skip to content

Instantly share code, notes, and snippets.

@matezito
matezito / class-fields-utils.php
Created February 20, 2021 14:43
Create form fields class (mini)
<?php
class Fields {
static private $initialized = false;
public static function initialize()
{
if (self::$initialized)
@matezito
matezito / class-flash-session.php
Created February 20, 2021 19:24
Flash Session
<?php
class Flash_Session {
static private $initialized = false;
public function __construct()
{
if (self::$initialized)
return false;
self::$initialized = true;
@matezito
matezito / querys.graphql
Last active August 25, 2021 11:44
Querys Presentación
"""
AllPosts
query - Iniciamos la consulta
PostsAll - Nombramos nuestra consulta para poder agrupar de ser necesario
posts - Entidad que consultamos
edges - Ayudan a definir partes de la query, podemos tener varios y ayudan con la paginación
node - un grupo o nodo de datos
"""
query PostsAll {
@matezito
matezito / grapqlexample.php
Created August 26, 2021 17:34
Extender WPGraphQL
<?php
/**
* Plugin Name: GraphQL Example
* Textdomain: graphqlexample
*/
/**
* Add logo and favicon images url to graphql schema in the rootquery. copy file into wp-content/plugins and then activate from Plugin's page.
**/
function get_logo()
{
@matezito
matezito / notes.txt
Last active March 18, 2022 16:14
Deploy SSH Github actions
Repo de runner: https://github.com/appleboy/ssh-action
La key que se debe configurar en los secrets del repo es la id_rsa (sin la extensión pub), o la que hayan generado, en mi caso genere una para esto nada mas como dice la documentación del repo runner.
@matezito
matezito / facturanteFE.php
Last active July 12, 2022 14:25
Factura E Facturante
<?php
$client = new SoapClient("http://testing.facturante.com/api/comprobantes.svc?wsdl");
$auth = array(
"Empresa" => 1111,
"Hash" => "hashdefacturante",
"Usuario" => "usuario@defacturante.com"
);