- Run:
git config --global core.hooksPath ~/githooks
- Create hooks folder:
mkdir ~/githooks
- Copy
pre-push
to the~/githooks
folder - Set executable:
chmod +x ~/githooks/pre-push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Every 4 Frames via find and a file | |
echo "Enter Video Name for folder: ";read VSRC; find . -type f -name '*.JPG' | sort | awk 'NR%4 == 1 {print "file \x27"$1"\x27"}' > $VSRC.txt; ffmpeg -f concat -safe 0 -i $VSRC.txt -c:v libx264 -b:v 10M -maxrate 10M -bufsize 4M -vf scale=-1:1080,format=yuv420p -r 30 $VSRC.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
something: | |
$(call prompt_run,echo "FUN!") | |
# Prompt the user to continue and exit the script if they choose no | |
define prompt_continue | |
@read -p "Contine and $(1)? " -n 1 -r REPLY; echo "\n"; \ | |
if [[ $$REPLY =~ ^[Nn]$$ ]]; then exit 1; fi | |
endef | |
# Prompt the user to run a given command, and keep going if they choose no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import hashlib | |
import os | |
import tempfile | |
import sys | |
def query_yes_no(question, default="yes"): | |
"""Ask a yes/no question via raw_input() and return their answer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from pygments import highlight, lexers, formatters | |
def pretty_json_file(fn): | |
print(highlight( | |
json.dumps(json.load(open(fn)), sort_keys=True, indent=2), | |
lexers.JsonLexer(), | |
formatters.TerminalFormatter(), | |
)) | |
Failures:
python -m example
SERVICE_USER=foo python -m example
Valid:
SERVICE_USER=foo SERVICE_PASS=bar python -m example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Send metrics over stdout for datadog lambda monitoring. | |
Monitoring details: | |
https://www.datadoghq.com/blog/monitoring-lambda-functions-datadog/ | |
""" | |
import time | |
from copy import copy | |
A quick example to allow easy environment variable injection for yamlsettings in lists. Normally a list can only be completely overriden via environement variables, this allows you to pick specific values to load in to a given entry.
Run with something like:
BAR_PASS=s3cr3t BAZ_PASS=god python example.py
I hereby claim:
- I am kylejameswalker on github.
- I am kylejameswalker (https://keybase.io/kylejameswalker) on keybase.
- I have a public key ASCW21fjaLLt721meHzL4foAVr3V44KfM0EX8cjlRUFDywo
To claim this, I am signing this object:
Converts a directory of low bitrate mp4 audio files to window media audio with ffmpeg.
This is a quick conversion for my car's CD player as it doesn't support mp4.