Skip to content

Instantly share code, notes, and snippets.

View BrianPugh's full-sized avatar
💭
⭐️ PRO

Brian Pugh BrianPugh

💭
⭐️ PRO
  • Washington D.C.
  • 11:33 (UTC -04:00)
View GitHub Profile
# Recursively copy all the avi videos in some file structure to a flat folder
# Source: https://stackoverflow.com/a/1936214
find . -iname '*.avi' -exec cp \{\} ../videos/ \;
# ffmpeg convert avi to mp4
ffmpeg -i infile.avi youroutput.mp4
# Convert all avi's in a folder to mp4 with ffmpeg
# Source: https://stackoverflow.com/a/33766147
for i in *.avi; do ffmpeg -i "$i" -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${i%.*}.mp4"; done
@BrianPugh
BrianPugh / xrb_stress_test_part2_5000.svg
Created January 26, 2018 07:45
SVG of the 5000 transaction test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BrianPugh
BrianPugh / xrb_stress_test_part2_500.svg
Created January 26, 2018 06:58
SVG of the 500 Transaction Initial Test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BrianPugh
BrianPugh / main_template.py
Created July 27, 2017 23:34
template for a python main file to get going as quickly as possible
#!/user/bin/env python
'''
This is a template file to get your project on the road quickly!
Last updated: July 27th, 2017
'''
__author__ = 'Brian Pugh'
__email__ = '[email protected]'
@BrianPugh
BrianPugh / optimistic restore
Last active September 12, 2017 19:29
optimistic restore
def optimistic_restore(session, save_file, variable_scope=''):
'''
A Caffe-style restore that loads in variables
if they exist in both the checkpoint file and the current graph.
Call this after running the global init op.
By DanielGordon10 on December 27, 2016
https://github.com/tensorflow/tensorflow/issues/312
With RalphMao tweak.
bpugh, July 21, 2017: Added a variable_scope so that a network can be
def get_checkpoints(checkpoint_dir):
'''
Finds all checkpoints in a directory and returns them in order
from least iterations to most iterations
'''
meta_list=[]
for file in os.listdir(checkpoint_dir):
if file.endswith('.meta'):
meta_list.append(os.path.join(checkpoint_dir, file[:-5]))
meta_list = sort_nicely(meta_list)
@BrianPugh
BrianPugh / Adding tmux
Last active December 8, 2020 17:45 — forked from sshadmand/Adding tmux
The best and greatest tmux.conf ever
Create a tmux conf file
#> touch ~/.tmux.conf
Install TMP
#> git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
[Copy and paste tmux.conf below into local file.]
Load tmux configurations
#> tmux source-file ~/.tmux.conf