Aaron McCall aaronmccall

View repo_status.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
reset=$(tput sgr0)
green=$(tput setaf 2)
cyan=$(tput setaf 6)
magenta=$(tput setaf 5)
bold=$(tput bold)
for arg in $( ls | egrep '^dsm-' ); do
(
cd "$arg"
if [ -e "./package.json" ]; then
View update_package.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
if [ $# -lt 2 ]; then
echo "Usage: update_package <directory> <package> [optional: <version>]"
exit 1
fi
 
if [ "$3" ]; then
version=$3
else
View findWhere.js
1 2 3 4 5 6 7 8 9 10
// returns first matching list member
function findWhere(list, props) {
var idx = 0;
var len = list.length;
var match = false;
var item, item_k, item_v, prop_k, prop_val;
for (; idx<len; idx++) {
item = list[idx];
for (prop_k in props) {
// If props doesn't own the property, skip it.
View findit.sh
1 2
# Recursive find in files with line numbers
find directory/ -name "*.html" -exec grep -ni "my search here" {} +
View LICENSE.txt
1 2 3 4 5 6 7 8 9 10
DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE
Version 1, December 2013
 
Copyright (C) 2013 Aaron McCall <https://github.com/aaronmccall>
 
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
 
DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE
View resolver.js
1 2 3 4 5 6 7 8 9 10
function resolver(prop_string, obj) {
if (!obj) return;
if (prop_string.indexOf('.') === -1) return obj[prop_string];
var props = prop_string.split('.'),
p = props.length,
result = obj,
i = 0,
prop;
for (; i<p; i++) {
prop = props[i];
View calcWeight.js
1 2 3 4 5 6 7 8 9 10
/*
* Function to calculate optimum weight to use based on preferred and minimum weight increments
* Args:
* startingWeight: the target weight
* minIncrement: the smallest increment that weight can increase by
* prefIncrement: this is our normal smallest increment (typically 2 * 2.5 with most weight sets)
* minMultiplier: how many of our minimum increment are available before we must return to our preferred
* increment.
*/
function calcWeight(startingWeight, minIncrement, prefIncrement, minMultiplier) {
View top_of_the_props.js
1 2 3 4 5 6 7 8 9
var Totp = (function ($, _) {
var body = $(document.body),
btn = $('<button type="button" class="pill-btn red-btn" id="top_of_the_props">Top Proppers</button>'),
counts = {},
pub = {},
names = [],
template = "",
url = 'https://www.fitocracy.com/notifications/?start=0&end=1000000',
key, count, list, renderer;
View pubsub.js
1 2 3 4 5 6 7 8 9 10
//PubSub
(function(attachTo, defaultContext) {
var topics = {},
attachTo = attachTo||this,
defaultContext = defaultContext||this,
__slice = function (obj) { return [].prototype.slice.call(obj) };
 
attachTo.publish = function() {
var args = __slice(arguments),
topic = args.shift();
View unix_line_endings.sh
1
tr '\015' '\n' < file_with_carriage_returns.txt > out && mv out file_with_carriage_returns.txt
Something went wrong with that request. Please try again.