Skip to content

Instantly share code, notes, and snippets.

View tncbbthositg's full-sized avatar

D. Patrick Caldwell tncbbthositg

View GitHub Profile
@tncbbthositg
tncbbthositg / README.md
Created March 9, 2022 20:40
OSX Command Line Encryption

Converting OpenSSH private key to RSA private key

ssh-keygen -p -N "" -f ~/.ssh/id_rsa -m pem

Creating a public key

ssh-keygen -e -m PKCS8 -f ~/.ssh/id_rsa
@tncbbthositg
tncbbthositg / gist:1bab06dbf823dfcb8f31f899512fd61c
Last active August 5, 2019 06:40
Stitching 360 videos from mi sphere
# ffmpeg -i steep_turn_corrected.MOV -acodec copy -vcodec copy steep_turn_corrected.mp4
# exiftool -ProjectionType="equirectangular" photo.jpg
ffmpeg -i hatcher_birthday1.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate0.ts
ffmpeg -i hatcher_birthday2.MOV -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "concat:intermediate0.ts|intermediate1.ts" -c copy -bsf:a aac_adtstoasc hatcher_birthday.mp4
@tncbbthositg
tncbbthositg / .vimrc
Last active June 4, 2018 13:24
The vim configuration I use for development
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/syntastic'
Plug 'vim-airline/vim-airline'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-commentary'
Plug 'slim-template/vim-slim'
Plug 'kchmck/vim-coffee-script'
@tncbbthositg
tncbbthositg / _text.scss
Last active December 11, 2015 00:07
Creating media specific alignments in SCSS
@mixin media-specific-styles($class) {
%#{$class} { @content; }
@each $size, $dim in $mq-sizes {
@include breakpoint($size) {
%#{$class}--#{$size} { @content; }
.#{$class}--#{$size} { @extend %#{$class}--#{$size}; }
}
}
}
@tncbbthositg
tncbbthositg / login_helper.rb
Last active October 6, 2015 16:34
Rspec helper module that logs in a user and avails that user to scenarios
module LoginHelper
def sign_in(user)
@signed_in_user = user
visit root_path
fill_in "Username", with: user.username
fill_in "Password", with: user.password
click_on "Log in"
end
@tncbbthositg
tncbbthositg / tricolor_example.c
Created September 23, 2015 15:35
Basic tri-color LED control with hex colors.
playColor(0x000000); // black
playColor(0xFFFFFF); // white
playColor(0xFF0000); // red
playColor(0x00FF00); // green
playColor(0x0000FF); // blue
playColor(0xFFFF00); // yellow
playColor(0x00FFFF); // cyan
playColor(0xFF00FF); // magenta
@tncbbthositg
tncbbthositg / sarcastic_snake.txt
Created September 23, 2015 13:49
Hubot sarcastic snake example
/meme https://dettoldisney.files.wordpress.com/2013/07/jungle-book-disneyscreencaps-com-943.jpg | Sarcastic Snake says: | SSSSure you can have gemssssss?
@tncbbthositg
tncbbthositg / ses_smtp_password.rb
Created August 13, 2015 15:50
Compute SES SMTP password from AWS secret key
#!/usr/bin/env ruby
require 'openssl'
require 'base64'
key = ARGV[0]
message = 'SendRawEmail'
version = 0x02
digest = OpenSSL::Digest.new('sha256')
@tncbbthositg
tncbbthositg / euler_1.rb
Created June 12, 2015 14:41
Solutions to Project Euler Problem #1
require 'benchmark'
def plain_map n
# Enter your code here. Read input from STDIN. Print output to STDOUT
three_or_five = -> i {i % 3 == 0 || i % 5 == 0}
total = (0...n.to_i).inject(0) do |sum, i|
next sum unless three_or_five.call(i)
sum + i
end
[1, 0, 2, 1, 0, 2, 1, 0, 2, 1]
[1, 0, 2, 1, 0, 2, 1, 0, 2, 1]
[1, 0, 2, 1, 0, 2, 1, 0, 2, 1]
user system total real
eager_map 0.370000 0.010000 0.380000 ( 0.373325)
lazy_map 1.130000 0.010000 1.140000 ( 1.142926)
composed 0.540000 0.000000 0.540000 ( 0.545507)
user system total real