Important
Este documento es un ejemplo completo de todas las capacidades ocultas y avanzadas del editor de Markdown de GitHub. ¡Explora y experimenta con cada detalle! 😎
Compartido en la newsletter para programadores en español: Web Reactiva
Important
Este documento es un ejemplo completo de todas las capacidades ocultas y avanzadas del editor de Markdown de GitHub. ¡Explora y experimenta con cada detalle! 😎
Compartido en la newsletter para programadores en español: Web Reactiva
| // PORT=4242 node webhook.mjs | |
| import http from 'http'; | |
| const PORT = process.env.PORT || 3000; | |
| const server = http.createServer((req, res) => { | |
| let body = []; | |
| req.on('data', (chunk) => { | |
| body.push(chunk); |
| import os | |
| import re | |
| import argparse | |
| # USE: python script.py ./srt-folder-source ./txt-folder-destination | |
| def convert_srt_to_txt(src_folder, dest_folder): | |
| for filename in os.listdir(src_folder): | |
| if filename.endswith('.srt'): | |
| src_path = os.path.join(src_folder, filename) |
| npm init -y // inicializa el repo | |
| npm i dotenv openai | |
| nano .env | |
| // En ese fichero tienes que definir estas API KEYS | |
| // OPENAI_API_KEY | |
| // WEATHER_API_KEY |
| version: "3.7" | |
| services: | |
| pocketbase: | |
| image: ghcr.io/muchobien/pocketbase:latest | |
| container_name: pocketbase | |
| restart: unless-stopped | |
| ports: | |
| - "8090:8090" | |
| volumes: |
| image: node:10.13-stretch | |
| before_script: | |
| - apt-get update -qq && apt-get install -y -qq sshpass | |
| deploy_production: | |
| stage: deploy | |
| environment: Production | |
| script: | |
| - npm install |
| #!/usr/bin/ruby1.9.1 | |
| # Script para traducir isbn a informacion del libro buscando en varias | |
| # librerias online. Se probo por ultima vez el 2009-12-11. | |
| # | |
| # Author:: Luis Parravicini | |
| # Copyright:: Copyright (C) 2009 Luis Parravicini | |
| # License:: GPL v2 | |
| # | |
| # http://ktulu.com.ar/blog/2009/12/11/traduciendo-isbn/ |
| const myString = "Comía Feliz el Ñandú cardo y kiwi"; | |
| myString.toLowerCase() | |
| .normalize('NFD') | |
| .replace(/([aeio])\u0301|(u)[\u0301\u0308]/gi,"$1$2") | |
| .normalize() | |
| .replace(/ñ/gi,"n") | |
| .replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '') | |
| .replace(/ +/g, '-'); |
| <?php | |
| class iCal | |
| { | |
| /** | |
| * @var string | |
| */ | |
| public $title; |
We want to upload file to a server with POST HTTP request. We will use curl functions.
// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");
// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");