Skip to content

Instantly share code, notes, and snippets.

View delineas's full-sized avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@delineas
delineas / script.py
Created December 9, 2023 00:36
Convert SRT to TXT batch mode
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)
@delineas
delineas / ejecutar-en-terminal
Last active August 14, 2023 20:24
Weather OpenAI function call completion
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
@delineas
delineas / docker-compose.yml
Created January 26, 2023 20:22
Pocketbase Docker
version: "3.7"
services:
pocketbase:
image: ghcr.io/muchobien/pocketbase:latest
container_name: pocketbase
restart: unless-stopped
ports:
- "8090:8090"
volumes:
@delineas
delineas / .gitlab-ci.yml
Last active February 3, 2022 08:19
Gatsby project CI/CD with deploy to other server
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
@delineas
delineas / isbn_search.rb
Created October 25, 2021 14:18 — forked from luisparravicini/isbn_search.rb
Busca la informacion de un libro segun su isbn
#!/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/
@delineas
delineas / replace.js
Created October 3, 2021 18:48
Replace text for anchor link
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, '-');
@delineas
delineas / iCal.php
Created September 23, 2021 20:14 — forked from seebz/iCal.php
iCal PHP Parser
<?php
class iCal
{
/**
* @var string
*/
public $title;
@delineas
delineas / __upload_file.md
Created March 22, 2021 08:33 — forked from maxivak/__upload_file.md
PHP upload file with curl (multipart/form-data)

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");
@delineas
delineas / gh-pages.yml
Created April 29, 2020 09:25 — forked from syuji-higa/gh-pages.yml
GitHub Actions - Genelate Nuxt.js deploy for GitHub Pages
name: github pages
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
@delineas
delineas / some_test.js
Created January 4, 2020 10:09 — forked from mbrochh/some_test.js
Controlling a Stripe payent popup with Cypress.io
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json
describe('Make Stripe Payment', function() {
before(function() {
cy.visit('http://localhost:3000/en/stripe/checkout/')
Cypress.Cookies.preserveOnce('sessionid')
})
it('should enter credit card details and finalise payment', function() {
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click()