Skip to content

Instantly share code, notes, and snippets.

Avatar

Johnny Opao johnnyopao

View GitHub Profile
@johnnyopao
johnnyopao / convert.sh
Created Dec 24, 2018
ffmpeg - Convert videos to smaller scale. Clean up filenames. Backup original
View convert.sh
for vid in */*.mp4
do
new_file_name=$(echo $vid | awk '{ gsub(/ /, "-"); gsub(/[&|\+|{|}]/, ""); gsub(/-+/, "-"); gsub(/-_-/, "-"); gsub(/(-[0-9]{3,})/, "") }; 1')
ffmpeg -i "./$vid" -filter:v "scale=w=800:h=-1" "./${new_file_name}"
backup_dir="./backup/$(dirname "$vid")"
mkdir -p $backup_dir && cp "./$vid" $backup_dir
@johnnyopao
johnnyopao / encrypt-all.sh
Created May 2, 2018
GPG Encrypt all files in directory
View encrypt-all.sh
#!/bin/bash
# This uses gpg to encrypt every file in a directory as separate
# encrypted files
# Usage
# ./encrypt-all.sh ./dir-of-files-to-encrypt "PASSPHRASE"
FILES="$1"
PASSPHRASE="$2"
View Dockerfile
FROM amazonlinux:latest
WORKDIR /app
# install pip
RUN curl -s https://bootstrap.pypa.io/get-pip.py | python
# requirements for compiling JAGs
RUN yum install -y \
gcc \
View handler.py
import os
import sys
CWD = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(CWD, "lib"))
# The example below was taken and modified from the pyjags documentation
# https://pyjags.readthedocs.io/en/latest/getting_started.html
import pyjags
View gist:1dee42d79e6ea0740e5a81da60e3c2fa
Verifying my Blockstack ID is secured with the address 1LicUSLFtg4GwSsLBCsB6TLkUbvhV4TNwR https://explorer.blockstack.org/address/1LicUSLFtg4GwSsLBCsB6TLkUbvhV4TNwR
@johnnyopao
johnnyopao / ubAdwordsCallTracking.html
Last active Jan 3, 2018
Unbounce - Adwords Call tracking - Consolidated (text/links/buttons) - See full instructions here: http://documentation.unbounce.com/hc/en-us/articles/203509834
View ubAdwordsCallTracking.html
<script>
// NOTE: If you want to track these links as conversion goals on Unbounce,
// change 'clkn' to 'clkg' in the commented areas below
// Add the button ID's to this array that you want tracked
// For example: ['#lp-pom-button-12', '#lp-pom-button-20']
var callButtons = [];
var ubCallback = function(formatted_number, unformatted_number) {
var numberLinks = document.getElementsByClassName('number_link');
View customMobileCssUnbounce.html
<style>
@media (max-width: 600px){
/*Custom CSS HERE */
}
</style>
@johnnyopao
johnnyopao / closeFormConfirmationDialog.md
Last active Jul 22, 2019
Close your Unbounce Form Confirmation Dialog lightbox with a button
View closeFormConfirmationDialog.md

Set the buttons URL to

javascript:lp.jQuery.ubpoverlay.close()
View FormSubmit.html
<script type="text/javascript">
function yourSubmitFunction(e, $) {
e.preventDefault();
//CUSTOM CODE HERE
// If your code is asynchronous, call this final line in your callback instead
lp.jQuery('.lp-pom-form form').submit();
}
You can’t perform that action at this time.