Skip to content

Instantly share code, notes, and snippets.

View mgoldey's full-sized avatar

Matthew Goldey mgoldey

View GitHub Profile
@mgoldey
mgoldey / crop_video.sh
Created August 16, 2018 18:38
crop a video using ffmpeg - 963 from right and 42 from bottom
ffmpeg -i datacorrection.mp4 -filter:v "crop=in_w-963:in_h-42:0:0" test.mp4
@mgoldey
mgoldey / docker_install.sh
Created August 23, 2018 17:14
install docker 1.12 on rhel
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.12.6-1.el7.centos.x86_64.rpm
yum install -y docker-engine-1.12.6-1.el7.centos.x86_64.rpm
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-selinux-1.12.6-1.el7.centos.noarch.rpm
yum install -y docker-engine-selinux-1.12.6-1.el7.centos.noarch.rpm
#/usr/bin/env bash
# does something every n times where here it's just printing from another list of ints
n=0;for i in {1..20}; do (((++n)%4)) || echo $i ; done
@mgoldey
mgoldey / file_serving_falcon_app.py
Created November 11, 2019 21:23
a small file serving falcon app
import os
import falcon
import mimetypes
class Files:
def on_get(self, req, resp, name=""):
"""Handles GET requests"""
PWD=os.path.abspath("./")
file_loc = os.sep.join([PWD,name])
if os.path.isfile(file_loc):
@mgoldey
mgoldey / ConvertToJSONSchema.go
Created July 20, 2020 19:57
demo that converts golang data structure to json schema
package main
import (
"encoding/json"
"fmt"
"github.com/alecthomas/jsonschema"
"time"
)
type TestUser struct {
ID int `json:"id"`
Name string `json:"name" jsonschema:"title=the name,description=The name of a friend,example=joe,example=lucy,default=alex"`