Skip to content

Instantly share code, notes, and snippets.

View sgraaf's full-sized avatar

Steven van de Graaf sgraaf

View GitHub Profile
@nl5887
nl5887 / convert.bash
Last active November 9, 2021 13:11
Quicktime to Animated gif using FFMPEG
#!/bin/bash
# convert to gif (improved palette) and 5 second still at the end
ffmpeg -i sans.mov -filter_complex "fps=25,setpts=PTS/5,split[v1][v2]; [v1]palettegen=stats_mode=full,tpad=stop_mode=clone:stop_duration=5 [palette];[v2][palette]paletteuse=dither=sierra2_4a" -loop 0 sans4.gif
@Julian-Nash
Julian-Nash / flask_sitemap_generator.py
Last active August 16, 2024 13:49
Flask dynamic sitemap generator
@app.route("/sitemap")
@app.route("/sitemap/")
@app.route("/sitemap.xml")
def sitemap():
"""
Route to dynamically generate a sitemap of your website/application.
lastmod and priority tags omitted on static pages.
lastmod included on dynamic content such as blog posts.
"""
from flask import make_response, request, render_template
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@ksafranski
ksafranski / Common-Currency.json
Last active August 31, 2024 05:55
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},