Skip to content

Instantly share code, notes, and snippets.

View nonoesp's full-sized avatar
💭
Getting Simple

Nono Martínez Alonso nonoesp

💭
Getting Simple
View GitHub Profile
@nonoesp
nonoesp / gist:a653fa793371b726eea5caa5cbd950f5
Created December 5, 2023 10:15
tldraw's DrawShapeUtil.tsx - custom render function to visualize control points and smoothing
/* eslint-disable react-hooks/rules-of-hooks */
import {
Box2d,
Circle2d,
Polygon2d,
Polyline2d,
SVGContainer,
ShapeUtil,
SvgExportContext,
TLDrawShape,
@nonoesp
nonoesp / calendar.blade.php
Created February 24, 2022 09:36
A Laravel view that generates a text/calendar feed you can subscribe to from calendar clients.
<?php
$vCalendar = new \Eluceo\iCal\Component\Calendar('www.nono.ma');
if(isset($item)) {
$collection = $item->collection();
foreach($collection as $i) {
@nonoesp
nonoesp / vue-lodash-sort-by.js
Created July 15, 2021 16:49
A simple Vue component (that uses Lodash) to sort a list of items.
let app = new Vue({
el: '.js--app',
data: {
sortBy: ['id'],
orderBy: ['desc'],
sketches: [
{ id: 0, name: 'Sketch 1' },
{ id: 1, name: 'Sketch 2' },
{ id: 2, name: 'Sketch 3' },
{ id: 3, name: 'Sketch 4' }
@nonoesp
nonoesp / hand-write.sh
Created May 24, 2021 14:56
Image transcription with Google Images Annotation API
export GOOGLE_APPLICATION_CREDENTIALS=./path/to/google-key.json
# Settings
INPUT_IMAGE=~/Desktop/input.jpg
# Variables
DATA_PATH=~/path/to/save/transcriptions
DATE_NOW=$(date '+%y%m%d_%H%M%S')
OUTPUT_IMAGE=$(echo $DATA_PATH)/$(echo $DATE_NOW)_image.jpg
OUTPUT_IMAGE_FULL=$(echo $DATA_PATH)/$(echo $DATE_NOW)_image-original.jpg
@nonoesp
nonoesp / playback-override.js
Last active April 22, 2021 15:50
Override Playback of Audio and Video HTML5 Elements
// Nono Martínez Alonso
// Nono.MA
// 2021.04.22
// MIT License
let overridePlaybackSpeed = 5;
let overridePlaybackVolume = 0;
setInterval(() => {
@nonoesp
nonoesp / ssh-auth-check.sh
Last active February 18, 2021 10:34
Verify whether a given private SSH key is authorized on a series of remote servers.
# Key to test
SSH_KEY_PATH=~/.ssh/id_rsa
# Add SSH key to authentication agent
ssh-add -K ${SSH_KEY_PATH}
echo "Verifying SSH access with key at ${SSH_KEY_PATH}"
for ip in \
"[email protected]" \

Work-in-progress document. These notes are loosely arranged and named. Take what you may. Thanks to @garciadelcast for contributing with his discoveries!


Here is a guide with personal notes to use FFmpeg and Imagemagick to automate all kinds of tricks in gif creation, video conversion, frame extraction, image processing, and more. These notes express a love for automating the automatable.

ffmpeg and convert (from ImageMagick)

FPS=1x30
@nonoesp
nonoesp / JavaScript to generate URLs
Last active June 7, 2019 17:31
SketchRNN model URLs
let models = [
'cat',
'bird',
'bicycle',
'octopus',
'face',
'flamingo',
'cruise_ship',
'truck',
'pineapple',
GetAvailablePort(8080);
@nonoesp
nonoesp / makeGIF.sh
Created May 18, 2017 19:32
Create a GIF with ImageMagick
convert -delay 30 00.png 01.png 02.png 03.png 04.png n.png animation.gif