Skip to content

Instantly share code, notes, and snippets.

ffmpeg -i input.mp4 -vf scale=360:640 -pix_fmt rgb24 output.gif
@gurunars
gurunars / cleanup_docker.sh
Created April 20, 2017 13:41
cleanup-docker
#!/bin/bash
docker ps -aqf "status=exited" | xargs -r docker rm -f
docker images -qf "dangling=true" | xargs -r docker rmi -f
docker volume ls -qf "dangling=true" | xargs -r docker volume rm
@gurunars
gurunars / gist:f3645a9289fd642242a1ce29d133a4d4
Created January 14, 2018 18:55
Regexp to replace all javaish docstrings that could be one-liners with one line docstrings e.g. via IntelliJ
Regexp:
\/\*\*\n\s*\*(.{1,80})\n\s*\*\/
With:
/**$1 */
From:
/**
* Foobar
*/
@gurunars
gurunars / birthday_loops.py
Last active June 5, 2019 10:07
Loopy and non loopy solutions
import json
def find_meaning(param):
return 11
def try_luck(param):
return 7
@gurunars
gurunars / ws-preinstall.mjs
Created August 7, 2024 07:13
Produces a yarn.lock that should be commented but does it ONLY for dev dependencies.
/** Inspired by https://classic.yarnpkg.com/blog/2016/11/24/lockfiles-for-all/
*
* Produces a yarn.lock that should be commented but does it ONLY for dev dependencies.
*/
import fs from 'node:fs'
import { execSync, exec } from 'node:child_process'
const getOutput = (cmd) => execSync(cmd).toString()
@gurunars
gurunars / rebase-feature-branch.sh
Created November 5, 2024 10:18
Rebase feature branch
FEATURE_BRANCH=fill-me
echo "Backup feature branch to server"
git checkout ${FEATURE_BRANCH}
git push origin ${FEATURE_BRANCH}
echo "Refresh main"
git checkout main
git pull origin main