Skip to content

Instantly share code, notes, and snippets.

@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active November 14, 2024 18:21
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@LauraBeatris
LauraBeatris / react-i18next.js
Last active October 30, 2023 11:48
Mock for react-i18next tests
const React = require('react');
const reactI18next = require('react-i18next');
/*
Also, if you're changing the language, add that mock function before your test suit
jest.mock('react-i18next', () => ({
useTranslation: () => ({
t: key => key,
i18n: { changeLanguage: jest.fn() },
@wtbarnes
wtbarnes / push-to-someone-elses-pr.md
Created March 5, 2020 04:49
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

@seeliang
seeliang / lint-only-changed-files.MD
Last active September 7, 2024 13:06
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@sffc
sffc / Gemfile
Last active July 12, 2020 09:27
Drop-in extension for image optimization during a Jekyll build. Save jekyll_image_optim.rb in your _plugins directory and make the stated changes to your Gemfile and _config.yml. https://blog.sffc.xyz/post/182420136145/optimized-images-in-jekyll
gem "image_optim", "~> 0.25"
gem "image_optim_pack", "~> 0.5.1"
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@ibeeger
ibeeger / webpack.config.js
Last active July 22, 2020 05:13
webpack.config.js multi-compiler Sequential execution
/**
webpack.config.js
**/
const webpack = require('webpack');
const env = process.env.NODE_ENV;
const configs = [{
name:"one",
entry:{
},
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@BretFisher
BretFisher / docker-for-mac.md
Last active November 8, 2024 13:45
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1