This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function degrees_to_direction ($degrees, $short=true) | |
{ | |
$dir_ary = [ | |
['N', 'North'], | |
['NNE', 'North Northeast'], | |
['NE', 'Northeast'], | |
['ENE', 'East Northeast'], | |
['E', 'East'], | |
['ESE', 'East Southeast'], | |
['SE', 'Southeast'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
#### borrowed heavily from https://stackoverflow.com/questions/53519058/how-to-delete-vpc-with-all-its-dependencies-using-boto3 | |
#### also found this online: https://github.com/jeffbrl/aws-vpc-destroy/blob/master/vpc_destroy.py | |
import boto3 | |
import json | |
import re | |
import sys | |
from pprint import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assume_role () { | |
SESSION_NAME=$1 | |
ROLE_ARN=$2 | |
export $(printf "AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s AWS_SESSION_TOKEN=%s" \ | |
$(aws sts assume-role \ | |
--role-arn $ROLE_ARN \ | |
--role-session-name $SESSION_NAME \ | |
--query "Credentials.[AccessKeyId,SecretAccessKey,SessionToken]" \ | |
--output text)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cat << EOF > test.filter-script | |
[0:v]kerndeint,format=pix_fmts=nv12,split=2[split1-1][split1-2]; | |
[split1-1]scale=-2:720,split=3[scale-720-1][scale-720-2][scale-720-3]; | |
[split1-2]scale=-2:540,split=2[scale-540-1][scale-540-2]; | |
[scale-720-1]fps=1/60[stills-1]; | |
[0:a]asplit=4[audio-1][audio-2][audio-3][audio-4] | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class for interacting with an SMB server using the system command "smbclient". | |
* Of course this assumes that you have the smbclient executable installed and | |
* in your path. | |
* | |
* It is not the most efficient way of interacting with an SMB server -- for instance, | |
* putting multiple files involves running the executable multiple times and | |
* establishing a connection for each file. However, if performance is not an | |
* issue, this is a quick-and-dirty way to move files to and from the SMB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AL": { | |
"name": "Alabama", | |
"capital": "Montgomery", | |
"lat": "32.361538", | |
"long": "-86.279118" | |
}, | |
"AK": { | |
"name": "Alaska", | |
"capital": "Juneau", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
window.onload = function() { | |
for (var links = document.links, i = 0, a; a = links[i]; i++) { | |
if (a.host !== location.host) { | |
a.target = '_blank'; | |
} | |
} | |
}; | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app > div > main > div > div.container.pl-5.pt-4.container--fluid.grid-list-xl > div > div.flex.page-col-sd.lg3.xl2 { | |
display: none | |
} | |
#app > div > main > div > div.container.grey.pa-0.container--fluid.lighten-4 > div > div { | |
margin-left: 0 | |
} | |
#app > div > main > div > div.container.pl-5.pt-4.container--fluid.grid-list-xl > div > div.flex.page-col-content.xs12.lg9.xl10 { | |
flex-basis: 100%; | |
flex-grow: 0; | |
max-width: 100% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function NestedScrollViewManager (parent_view) | |
{ | |
// Appcelerator Titanium code for managing scrollviews inside of scrollviews (not true Android | |
// NestedScrollViews, but just a horizontal scrollview inside of a vertical scrollview). | |
// | |
// If you want to put a horizontal scrollview inside a vertical scrollview (like the Netflix app UI), | |
// it seems to work reasonably well on iOS. But on android, the user experience is very janky. | |
// Unless the user's drag movements are nearly exactly horizontal, there will be some movement of | |
// the parent scrollview, and then it becomes very difficult to scroll the child view. Flinging is | |
// almost impossible. |
NewerOlder