Skip to content

Instantly share code, notes, and snippets.

View hu9osaez's full-sized avatar

Hugo Sáez hu9osaez

  • Santiago, Chile
View GitHub Profile
@akazakou
akazakou / openai_transcribe.sh
Created September 19, 2025 18:16
There is sample for the using OpenAI from console to transcript Speech To Text. Required OpenAI key, ffmpeg and curl
# Transcribe long videos via OpenAI Audio API in 1400s chunks
openai_transcribe() {
local USAGE
USAGE=$'%F{cyan}Usage:%f openai_transcribe <input_video> <output_text> [--model MODEL] [--chunk SECONDS] [--format text|srt|vtt|json]\n'\
$'%F{cyan}Example:%f openai_transcribe "2025-09-19 11-04-11.mkv" meeting.txt --chunk 1400 --model gpt-4o-transcribe\n'\
$'\nOptions:\n'\
$' --model OpenAI model (default: gpt-4o-transcribe)\n'\
$' --chunk Chunk length in seconds (default: 1400)\n'\
$' --format response_format (text|srt|vtt|json; default: text)\n'\
$'\nNotes:\n'\
@JacobWeisenburger
JacobWeisenburger / zustandCustomPersistStorageTemplate.ts
Created March 31, 2023 16:16
Zustand custom persist storage template
import { createStore } from 'zustand'
import { persist, StorageValue } from 'zustand/middleware'
const store = createStore(
persist(
() => ( {} ),
{
name: 'store-state',
storage: {
async getItem ( name: string ): StorageValue<unknown> {
@Baldinof
Baldinof / Caddyfile
Created July 8, 2021 16:06
PHP-fpm with Caddy web server
{
supervisor {
php-fpm
}
}
:8080
php_fastcgi 127.0.0.1:9000
root * .
@levelsio
levelsio / makebook_obfuscate.php
Last active September 3, 2025 16:37
Obfuscate your ebook so that people who didn't pay can read it, partly
<?php
/*
I wrote this function to progressively obfuscate text in MAKEbook.io. When it KINDA worked, I just used it.
It can take a lot of improvement. I kinda just tweaked the values until it was good enough. It's not SO progressive though.
It takes all the output of your PHP scripts via ob_start(), reroutes that to the obfuscation function.
You should check if user paid for book or not, then either run ob_start or not!
@simenbrekken
simenbrekken / schema.js
Created December 21, 2016 14:06
Firebase backed GraphQL schema
import firebase from 'firebase'
import { filter, map } from 'lodash'
import { makeExecutableSchema } from 'graphql-tools'
firebase.initializeApp({
databaseURL: 'https://grafire-b1b6e.firebaseio.com',
})
const mapSnapshotToEntity = snapshot => ({ id: snapshot.key, ...snapshot.val() })
const mapSnapshotToEntities = snapshot => map(snapshot.val(), (value, id) => ({ id, ...value }))
@vivirenremoto
vivirenremoto / gist:3e90e9d5bf0a9348e298
Created March 6, 2016 12:03
redirección recetas
<html>
<head>
<title>Recetas de la abuela</title>
</head>
<body>
<script>
document.location.href = "https://play.google.com/store/apps/details?id=miquelcamps.com.recetas&via=fb";
</script>
</body>
@joshnuss
joshnuss / app.js
Last active November 4, 2025 22:39
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@andrewluetgers
andrewluetgers / gist:927fb8a8651d7a713365
Created February 5, 2015 16:38
Webpack + React + Stylus, Dev: Hotloat, Build: File Output
var webpack = require('webpack'),
path = require('path'),
ExtractTextPlugin = require("extract-text-webpack-plugin"),
isDev = process.env.NODE_ENV;
var config = {
cache: true,
resolve: {
extensions: ["", ".js", ".css", ".styl"]
@juriansluiman
juriansluiman / comments.tag
Created January 28, 2015 10:49
The react tutorial for riot
<comment-box>
<h1>{ opts.title }</h1>
<comment-list url={ opts.url } comments={ comments } />
<comment-form url={ opts.url } />
this.comments = []
add(comment) {
this.comments.push(comment)
@edouard-lopez
edouard-lopez / gulpfile.js
Created May 5, 2014 15:18
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();