Skip to content

Instantly share code, notes, and snippets.

View jnbek's full-sized avatar

John D Jones III jnbek

View GitHub Profile
@jnbek
jnbek / gist:4ffc1d9726e7cd7bd64e4b2f4951055e
Created February 14, 2024 18:04
Rotate in Javascript
document.getElementById("site-main").style.transform= "rotate(90deg)";
@jnbek
jnbek / getopts.c
Created February 7, 2024 21:45
GetOpt Example
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main (int argc, char **argv)
{
int verbose = 0;
int help = 0;
@jnbek
jnbek / Bash Install Script.sh
Created December 29, 2022 22:37
an old bash install script for my dotfiles and stuff
#!/usr/bin/env bash
# Usage: ./install.sh [--no-bak]
# --no-bak erases the .vim/ directory backup, if it exists as a directory.
if [ -d ${HOME}/.vim/ ]; then
mv ${HOME}/.vim $HOME/.vim.bak;
fi;
for i in _*
do
source="${PWD}/$i"
@jnbek
jnbek / json.lua
Created December 7, 2022 00:42 — forked from tylerneylon/json.lua
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@jnbek
jnbek / distance_between_coords.rs
Last active November 13, 2022 18:34
Get the distance between two degrees
fn main() {
let earth_radius_kilometer = 6371.0_f64;
let (paris_latitude_degrees, paris_longitude_degrees) = (48.85341_f64, -2.34880_f64);
let (london_latitude_degrees, london_longitude_degrees) = (51.50853_f64, -0.12574_f64);
let paris_latitude = paris_latitude_degrees.to_radians();
let london_latitude = london_latitude_degrees.to_radians();
let delta_latitude = (paris_latitude_degrees - london_latitude_degrees).to_radians();
let delta_longitude = (paris_longitude_degrees - london_longitude_degrees).to_radians();
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:76: unknown key: confirm-before [0/0]/mnt/c/Users/jnbek/dotfiles/_tmux.conf:113: invalid option: status-attr
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:117: invalid option: window-status-fg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:119: invalid option: window-status-bg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:120: invalid option: window-status-attr
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:123: invalid option: window-status-current-fg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:124: invalid option: window-status-current-bg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:125: invalid option: window-status-current-attr
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:128: invalid option: message-fg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:129: invalid option: message-bg
/mnt/c/Users/jnbek/dotfiles/_tmux.conf:130: invalid option: message-attr

Conversion without lose of Quality

ffmpeg -i file.mov -c copy out.mp4

you can remove audio by using the -an flag

Conversion with Compression

ffmpeg -i input.mov -vcodec libx264 -crf 20 output.mp4
@jnbek
jnbek / 0.2-BETA FFMPEG_Concat-DateTime-Logo-Music.ps
Last active April 27, 2022 15:15
Some ffmpeg things I may need
#Unfortunately, this isn't perfect yet, it prints the date/time in real time, while the timelapse proceeds at 5x, need to figure this part out.
#See: https://superuser.com/questions/1013753/how-can-i-overlay-the-captured-timestamp-onto-a-video-using-ffmpeg-in-yyyy-mm-dd
ffmpeg -f concat -safe 0 -i .\mylist.txt -i aliengeek.gif -i cagar.mp3 -filter_complex drawtext="fontfile=Pacifico.ttf: text='%{localtime\:%c}':x=(w-text_w)/2:y=(h-text_h)/2:fontsize=44:fontcolor=white",select='not(mod(n\,5))',setpts=N/FRAME_RATE/TB,fps=60,"overlay=x=main_w-overlay_w-(main_w*0.01):y=main_h-overlay_h-(main_h*0.01)" -vcodec libx264 -map 0:v:0 -map 2:a:0 -c:a aac -b:a 192k -shortest timelapse_all.mp4
@jnbek
jnbek / devops_borat.dat
Created October 21, 2021 18:01 — forked from textarcana/devops_borat.dat
The wisdom of Devops Borat (RIP, may Taichi Ohno himself carry him into Valhalla!) condensed in fortune cookie format without any @ messages included. Just the goofiest random shit :)
I remember very clear I cry when I finish volume 3 of Knuth.
%
I am work on CSS SQL.
%
First sign of depression in devops is denial: you start of ignore Nagios alert.
%
In devops language is not success unless is another language++.
%
In devops you are addict to graph if first thought after orgasm is send duration and intensity to Graphite.
%
cpanm --self-contained -L ~/perl_webapp Mojo::IRC JavaScript::Minifier::XS CSS::Minifier::XS Bootylicious Minion YAML::XS JSON::XS String::Markov Facebook::Graph Imgur::API Flickr::API