Skip to content

Instantly share code, notes, and snippets.

View sjardim's full-sized avatar
Working from home

Sérgio Jardim sjardim

Working from home
View GitHub Profile
sjardim / simulated-typing.html
Created June 27, 2023 18:33 — forked from fontanon/simulated-typing.html
Simulate typing on HTML Input Box with Javascript
View simulated-typing.html
<title>Simulated typing</title>
<input type="text" id="transcribe-searchbox" placeholder="Escribe Aquí">
<input type="button" id="transcribe-button" value="Transcibir a Andaluz">
// Quotes to simulate typing, then deletion
View diminuir_tamanho_arquivos_mp4.txt
# Salvar num arquivo ~/, conceder direito de execução e
# executar desta forma (adaptar nomes de diretórios e arquivos para seu caso):
# $ ~/ ~/Video/bigFile.mp4 ~/Video/smallFile.mp4
ffmpeg -i "$1" -vcodec h264 -acodec aac "$2"
sjardim /
Created February 1, 2022 15:25 — forked from chrispymm/
[Support nested urls for nested modules] #twill

By default Twill will disply the url of a module item to be {siteurl}/{module}/{slug} e.g. With the 'about' section being the editable slug. This is understandable as Twill knows nothing of your frontend routing. However it is likely confusing for editors, as that url presented will not be the final url of the content.

Remove module name form url

This will give us more correct urls e.g.

// app/Http/Controllers/Admin/PageController

	protected $permalinkBase = '';

Prefill a block editor from a selection of templates


  • Create a new module with a template field
  • Prefill the block editor for new items according to the selected template


View get_MP3_tags_and_duration.php
//Blog post:
//Tested ID3v2.2 and v2.4 and on UTF-8 and UTF-16LE encondings
// $file = 'audio.mp3';
sjardim / ProcessWireValetDriver.php
Created February 10, 2021 11:47 — forked from LostKobrakai/ProcessWireValetDriver.php
ProcessWire Valet Driver
View ProcessWireValetDriver.php
class ProcessWireValetDriver extends BasicValetDriver
private $possibleDirectories = [
'', // PW in root, do not remove except you're sure you never use it
View gist:45cebbed791d4c0085d43af40072d2b1
Sub Export4KPowerpoint()
If ActivePresentation.CreateVideoStatus <> ppMediaTaskStatusInProgress Then
ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\export.mp4", _
UseTimingsAndNarrations:=True, _
VertResolution:=2160, _
FramesPerSecond:=30, _
Else: MsgBox "There is another conversion to video in progress"
End If
End Sub
View gulpfile.js
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed:
tinylr = require('tiny-lr'),
express = require('express'),