Skip to content

Instantly share code, notes, and snippets.

@jwliechty
jwliechty / corporate_speak.txt
Created March 2, 2020 15:30
Corporate Speak
Pump the breaks
Throttle
Squeeze the baloon
Wrapped around the axle
Synergy
Teamwork makes the dreamwork
Eat your own dogfood
@jwliechty
jwliechty / networking_tricks_windows_10.md
Last active February 11, 2020 19:39
Windows 10 Network Troubleshooting

Windows 10 Firewall Settings

To allow an application to have access in the firewall, do the following:

  1. Type "Firewall and network protection" in the Taskbar search box
  2. Click "Allow an app through firewall"
  3. Determine if the app in question is already in the list. If so, there should be two entries - one checked for "Public" and another checked for "Private". However, only the line for the "Private" network should be marked as checked unless you need the "Public" as well. A given line is considered enabled if
@jwliechty
jwliechty / get_version.sh
Created November 6, 2015 20:59
Get maven version of a project via command line
mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -Dexpression=project.artifactId -f '/path/to/pom.xml' 2>/dev/null | grep -Ev '^(\[|Download\w+:)'
@jwliechty
jwliechty / port_commands.sh
Created October 14, 2015 14:33
Who's port is is anyway??
# who is using port 4329
lsof -i :4329
netstat -an | grep :4329
netstat -peanut | grep :4329 # netstat -taupen
@jwliechty
jwliechty / removeSubmodule.sh
Created October 8, 2015 16:36
Remove Git submodule
#!/bin/bash -e
# Based on article http://davidwalsh.name/git-remove-submodule
MODULE_PATH="${1:?You must speicify the module path}"
determinePaths(){
[ -d "${MODULE_PATH}" ] || die "Module directory does not exist: ${MODULE_PATH}"
MODULE_PATH="$( cd "${MODULE_PATH}"; pwd )"
GIT_ROOT="$( cd "$( dirname "${MODULE_PATH}" )"; git rev-parse --show-toplevel )"
@jwliechty
jwliechty / git_library.sh
Last active October 21, 2015 15:59
Bash Library for Git Operations
# Library methods for git operations
# See http://stackoverflow.com/questions/2657935/checking-for-a-dirty-index-or-untracked-files-with-git
git::run_test(){
if git::has_staged_changes; then
echo "There are staged changes"
fi
if git::has_working_changes; then
echo "There are working changes"
fi
@jwliechty
jwliechty / exampleWithFindExex.sh
Last active August 11, 2021 20:29
Example of how to use find exec calling a function.
#/bin/bash
export MY_EXPORTED_VAR="Boo Yeah!"
MY_NON_EXPORTED_VAR="You won't see this one!"
# This script was inspired by the answer to the question in
# http://unix.stackexchange.com/questions/50692/executing-user-defined-function-in-a-find-exec-call
runFindCommand(){
# 'myFunct "$@"' will call the function with the arguments passed into the shell
@jwliechty
jwliechty / iterateRepoBranches.sh
Last active August 29, 2015 14:27
Iterates over the branches of a repository, executing a command (or custom script) on each checked out branch.
#!/bin/bash -e
REPO_PATH=/home/jwliechty/dev/release/ascent-assays
COMMAND="$1"
ARG_COUNT="$#"
usage(){
cat <<-END
Usage: $(basename $0) COMMAND
@jwliechty
jwliechty / bad_boys.js
Last active August 29, 2015 14:27
Slow Teaspoon Test Reporter
(function(){
var duration = $('#teaspoon-stats-duration').text();
var naughty = $('.slow span');
var worst = $.makeArray(naughty.map(function(){return parseInt($(this).text().replace('ms', ''))}).sort(function(a, b){return b - a})).slice(0, 5).join(', ');
console.log('duration: ' + duration);
console.log('count: ' + naughty.size());
console.log('worst: ' + worst);
return null;
}());
@jwliechty
jwliechty / common_regexes.md
Last active August 29, 2015 14:21
Common Regexes

Format of the following will be

'SEARCH'
'REPLACE'

Where SEARCH is the regex search and REPLACE is the replacement text. The quotes (') are for showing if there is any proceeding or trailing whitespace.

Hashrocket Hash to JSON Hash

':([^\s=\)]+)\s+=>\s+'