Skip to content

Instantly share code, notes, and snippets.

View ginixsan's full-sized avatar

Ginés Sanz ginixsan

View GitHub Profile
@ginixsan
ginixsan / wildcard-ssl-certificate.md
Created October 15, 2024 14:00 — forked from utek/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

Request a new certificate

Get certbot

Go to any directory and clone repo with sources.

cd ~
git clone https://github.com/certbot/certbot
@ginixsan
ginixsan / index.pug
Created June 23, 2024 07:57 — forked from CodeMyUI/index.pug
Order confirm animation
button(class='order')
span(class='default') Complete Order
span(class='success') Order Placed
svg(viewbox='0 0 12 10')
polyline(points='1.5 6 4.5 9 10.5 1')
div(class='box')
div(class='truck')
div(class='back')
div(class='front')
div(class='window')
@ginixsan
ginixsan / github-context.json
Created May 9, 2024 13:16 — forked from colbyfayock/github-context.json
Sample payload for Github Action `github` context
{
"token": "[token]",
"job": "notifySlack",
"ref": "refs/pull/4/merge",
"sha": "[shad]",
"repository": "colbyfayock/demo-github-actions",
"repository_owner": "colbyfayock",
"repositoryUrl": "git://github.com/colbyfayock/demo-github-actions.git",
"run_id": 120667610,
"run_number": "2",
@ginixsan
ginixsan / podforceupdate.sh
Created April 8, 2024 15:26 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@ginixsan
ginixsan / remove_silence.py
Created December 20, 2023 07:08 — forked from sotelo/remove_silence.py
Remove silences
# From https://stackoverflow.com/questions/29547218/
# remove-silence-at-the-beginning-and-at-the-end-of-wave-files-with-pydub
from pydub import AudioSegment
def detect_leading_silence(sound, silence_threshold=-50.0, chunk_size=10):
'''
sound is a pydub.AudioSegment
silence_threshold in dB
chunk_size in ms
@ginixsan
ginixsan / audio_silence.js
Created December 19, 2023 08:38
audio with silence detecion in javascript
VOICE_MIN_DECIBELS = -35;
DELAY_BETWEEN_DIALOGS = 400;
DIALOG_MAX_LENGTH = 60*1000;
MEDIA_RECORDER = null;
IS_RECORDING = false;
//startRecording:
function startRecording(){
IS_RECORDING = true;
record();
@ginixsan
ginixsan / xml_split.py
Created June 13, 2023 15:06 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@ginixsan
ginixsan / parse_pubmed.py
Created June 3, 2023 15:58 — forked from jasonrig/parse_pubmed.py
Verify and extract abstracts from PubMed
import csv
import glob
import gzip
import hashlib
import xml.sax
import tqdm
file_list = glob.glob("./pubmed/*.xml.gz")
import sys
import openai
import json
import pandas as pd
from Bio import Entrez
from datetime import datetime
from PyQt6 import QtWidgets, QtGui
from PyQt6.QtCore import Qt
# Replace with your own ChatGPT API key
import os
import re
import gzip
import hashlib
from tqdm import tqdm
from bs4 import BeautifulSoup, SoupStrainer
fnames = []
for fname in os.listdir('PubMed'):
if fname.endswith('.xml'):