Skip to content

Instantly share code, notes, and snippets.

View pablojimeno's full-sized avatar
🔬
learning

Pablo Jimeno pablojimeno

🔬
learning
View GitHub Profile

Alpine.js fetch data on x-init

Fetch Gist API, parse the Gist description for titles and tags (via Lepton Snippet Manager) and save it to sessionStorage to not hit the API too often.

A Pen by vsamaru on CodePen.

License.

@pablojimeno
pablojimeno / alpine-api-data-in-table.html
Created March 15, 2023 18:33 — forked from w3collective/alpine-api-data-in-table.html
Displaying API data in a HTML table with Alpine.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Alpine.js: Displaying API data in a HTML table</title>
<style>
[x-cloak] {
display: none !important;
}
@pablojimeno
pablojimeno / example_jekyll.md
Last active March 16, 2023 12:43 — forked from patrickfav/example_jekyll.md
A Liquid Filter for obfuscating an Email Address (can be used with Jekyll aswell)

In Jekyll set a variable for the mail, e.g. in the _config.yml

email: name@mail.com

then use it in your page

Reach me under:	{{ site.email | mailObfuscate }}

which will generate the following HTML

@pablojimeno
pablojimeno / README.md
Created January 25, 2022 08:36 — forked from joelverhagen/README.md
Jekyll YouTube Embed Plugin

This is a plugin meant for Jekyll.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

{% youtube oHg5SJYRHA0 %}
@pablojimeno
pablojimeno / vtt2text.py
Created July 27, 2021 09:59 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
function onOpen()
{
var ui = SpreadsheetApp.getUi();
ui.createMenu('Process')
.addItem('Approve', 'doApprove')
.addToUi();
}
function doApprove()
{
@pablojimeno
pablojimeno / # openssl@1.0 - 2020-09-27_14-09-58.txt
Created October 8, 2020 16:32
openssl@1.0 (rbenv/tap/openssl@1.0) on macOS 10.15.7 - Homebrew build logs
Homebrew build logs for rbenv/tap/openssl@1.0 on macOS 10.15.7
Build date: 2020-09-27 14:09:58
@pablojimeno
pablojimeno / bluetooth-restart.sh
Created January 28, 2020 18:03 — forked from thiagoghisi/bluetooth-restart.sh
Script for Mac OSX to Restart Bluetooth service & Reconnect all recently paired devices
#!/bin/bash
echo "Restarting bluetooth service..."
blueutil -p 0 && sleep 1 && blueutil -p 1
echo "Waiting bluetooth service to be restored..."
until blueutil -p | grep "1" >/dev/null; do sleep 1; done
echo "Searching for devices not connected..."
devices=($(blueutil --paired | grep "not connected" | awk -F '[ ,]' '{print $2}'))
@pablojimeno
pablojimeno / gist:dfe01c295a19cbce9700982df5199336
Created November 14, 2018 17:08 — forked from mayoff/gist:1138816
AppleScript to make Google Chrome open/reload a URL
(* To the extent possible under law, Rob Mayoff has waived all copyright and related or neighboring rights to “AppleScript to make Google Chrome open/reload a URL”. This work is published from: United States. https://creativecommons.org/publicdomain/zero/1.0/ *)
tell application "Google Chrome"
activate
set theUrl to "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
if (count every window) = 0 then
make new window
end if
set found to false