Skip to content

Instantly share code, notes, and snippets.

@jalexanderfox
jalexanderfox / templateProxy.sh
Last active December 15, 2015 15:49
Template Proxy
#!/bin/bash
assignProxy(){
HTTP_PROXY_ENV="http_proxy ftp_proxy all_proxy HTTP_PROXY FTP_PROXY ALL_PROXY"
HTTPS_PROXY_ENV="https_proxy HTTPS_PROXY"
for envar in $HTTP_PROXY_ENV
do
export $envar=$1
done
for envar in $HTTPS_PROXY_ENV
@jalexanderfox
jalexanderfox / dockerStopAllAndDeleteAllContainersAndImages.sh
Created December 13, 2015 19:50
Stop all running docker containers, then delete them all including their images (useful for when a containers get corrupted and an automated process pulls the latest)
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
console.log("Usage Syntax: scanScope($scope.model, 'SCANFOR');");
function scanScope(whatToScan, scanValue, parentTree) {
var insertString = '';
for (var key in whatToScan) {
if (((whatToScan[key] != null) && (whatToScan[key].indexOf != undefined) && whatToScan[key].indexOf(scanValue) > -1) || key.indexOf(scanValue) >= 0) {
if (parentTree != null) {
insertString = parentTree + '.';
} else {
insertString = '';
}
@jalexanderfox
jalexanderfox / dabblet.css
Created February 5, 2014 19:15
rotated heading
/**
* rotated heading
*/
#testwrap { border:1px solid red; height:300px; position:relative; width:80% }
#testwrap:before { content:"test"; background:blue; color:orange; }
#testwrap:before {
transform: rotate(90deg);
-webkit-transform: rotate(90deg);
@jalexanderfox
jalexanderfox / nav_item_auto_indicate.js
Last active December 16, 2015 21:59
Automatically indicate (highlight or style) the current navigation items for current the url (jQuery help). window.location.pathname compared to anchor hrefs of each navigation item.
//NOTE: you should put this in a function (closure)
//characters not allowed in pagename
var x_chars = ['?', '&', '#'];
/*
extract_pagename helps insure that when names are used for comparison,
the names will be clean and clear of any unwanted query strings, hashes or other special characters
though this method is not necessary for