Skip to content

Instantly share code, notes, and snippets.

@zkmark
zkmark / get_text_between_characters_and_replace_value.js
Created December 2, 2022 21:08
Obtener texto entre 2 caracteres y remplazar valor
let text = 'hello :name; ok :name2; ok2'
let the_value_to_search = ':'
let the_value_to_search2 = ';'
let the_new_value_to_replace = '+'
let regex_between = new RegExp(`${the_value_to_search}(.*?)${the_value_to_search2}`, 'gi');
const matches = text.matchAll(regex_between);
let the_text_end = Array.from(matches, x => x[1]).join(the_new_value_to_replace).toString();
console.log(the_text_end);
@zkmark
zkmark / PlayerController
Created December 20, 2019 04:00
Unity PlayerController
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed;
public float jumpForce;
private float moveInput;
@zkmark
zkmark / form.ts
Last active November 7, 2019 04:49
Validation With Services angular
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators, ValidatorFn, ValidationErrors, AbstractControl } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from '@core/services/auth/auth.service';
@Component({
selector: 'app-page-config',
templateUrl: './page-config.component.html',
styleUrls: ['./page-config.component.scss']
})
@zkmark
zkmark / Angular routing module
Created October 8, 2019 01:28
Angular routing module
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class PagesblankRoutingModule { }
@zkmark
zkmark / List nested Jquery
Created March 24, 2019 02:09
List nested Jquery
$(document).ready(function () {
//"parentId": null,
var menuItems = {
"menu-6": {
"id": "menu-6",
"link_text": "Docs",
},
"menu-7": {
"id": "menu-7",
@zkmark
zkmark / lastpost.blade.php
Created October 25, 2018 16:12
Last Post With Acf meta_query
@if ($tipo_de_post == 'ultimos_post_de_idioma')
<?php
$cantidad_de_post = get_sub_field('cantidad_de_post') + 10;
$ultimos_post_de_idiomas = get_sub_field('ultimos_post_de_idiomas');
$id_of_series = [];
$list_of_series = get_posts([
'post_type' => 'post',
'posts_per_page' => $cantidad_de_post,
@zkmark
zkmark / footer.blade.php
Last active November 30, 2017 16:51
Social Icons Kirki
Verifying my Blockstack ID is secured with the address 1AJaGSMANZMwaFLRnaoxGBbePVm3sXQdXE https://explorer.blockstack.org/address/1AJaGSMANZMwaFLRnaoxGBbePVm3sXQdXE
@zkmark
zkmark / Buscar palabras en archivo con php
Created January 21, 2016 00:02
Buscar palabras en un archivo html con php
<?php
/**
* Función recursiva que busca una palabra dentro de los archivos html
* contenidos en nuestro servidor.
*
* http://www.lawebdelprogramador.com
*/
set_time_limit(300);
@zkmark
zkmark / clases simples con poo
Last active January 21, 2016 00:03
clases simples con poo para 2 archivos
<?php
//Creá una clase Perro
class Perro{
//Agregá una propiedad public que se llame
//$cantidadDePatas, que almacena el valor 4 en la clase Perro
public $cantidadDePatas = 4;
//Agregá otra propiedad Public que se llame $nombre,
//que no contenga ningún valor
public $nombre;