Skip to content

Instantly share code, notes, and snippets.

View xionluhnis's full-sized avatar

Alexandre Kaspar xionluhnis

View GitHub Profile
@xionluhnis
xionluhnis / create_timelapse.sh
Created January 11, 2023 15:39
Generate a timelapse from JPG images using FFMPEG
#!/usr/bin/env bash
[[ -z "$FR" ]] && FR=30
[[ -z "$W" ]] && W=-1
[[ -z "$H" ]] && H=1080
[[ -z "$F" ]] && F=0.125
[[ -z "$TR" ]] && TR=2
INPUT="$1"
[[ -n "$2" ]] && OUTPUT="$2" || OUTPUT="${INPUT//\/}.mp4"
# ffmpeg -framerate $FR -pattern_type glob -i "$INPUT/*.JPG" -c:v libx264 -crf 17 -pix_fmt yuv420p -vf "transpose=0" -vf scale=-1:800 "$OUTPUT"
@xionluhnis
xionluhnis / generate-programs.js
Created August 29, 2022 18:43
Generating javascript programs from a set of characters
"use strict"
const chars='+[]'.split('')
let pastStrings=[...chars]
const outs=[]
const num = 12 // number of characters to try appending
let best = null
mainLoop:
for(let i=0;i<num;++i){
let newStrings=[]
for(const preStr of pastStrings){
@xionluhnis
xionluhnis / CudaMemory.h
Last active December 14, 2015 19:09
Cuda Memory wrapper class
/*
* Cuda memory wrapper
*/
#ifndef CUDAMEMORY_H
#define CUDAMEMORY_H
#ifndef NDEBUG
#include <iostream>
#include <stdlib.h>
@xionluhnis
xionluhnis / fetchmail.sh
Last active December 12, 2015 04:08
Fetching mail from pop3 via bash. Accept any pop3 command, augmented with a "last" command.
#!/bin/bash
# Wed Jun 16 16:04:19 EDT 2004
# NAME: p1
# Copyright 2004, Chris F.A. Johnson
# Released under the terms of the GNU General Public License
# Modified by Alexandre Kaspar <xion.luhnis(at)gmail(dot)com>
# Using https://gist.github.com/jjarmoc/1571540
CR=$'\r' ## carriage return; for removal of