Skip to content

Instantly share code, notes, and snippets.

View Gpx's full-sized avatar

Giorgio Polvara Gpx

View GitHub Profile
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@Gpx
Gpx / Messages.js
Created December 6, 2012 11:00
Check if user is logged in Express otherwise redirect to /login
// Set an error message and redirect
var redirectWithMessage = function (message, url, req, res) {
req.session.messages = message;
res.redirect(url);
};
// Return 'messages' value or null instead
var getMessages = function (req) {
var messages = req.session.messages || null;
delete req.session.messages;
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu