Skip to content

Instantly share code, notes, and snippets.

View conchoecia's full-sized avatar

darrin t schultz conchoecia

View GitHub Profile
@mslinn
mslinn / maxmem
Last active February 19, 2019 20:58
Shows the maximum memory of any running process. Let it run to completion or Ctrl-C to get instant result
#!/usr/bin/env bash
function help {
echo "$(basename $0) shows the maximum memory used by any running process, including daemons.
Let it run to completion or Ctrl-C to terminate.
The process can be specified by name (case insensitive) or by PID.
Non-java processes are matched against their full name, not including the path.
$(basename $0) has special matching for Java processes:
a) It can match the command line for Java processes, however it may not select the proper
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@brantfaircloth
brantfaircloth / paths_to_full_paths.py
Created September 30, 2011 00:27
Convert paths to full paths (argparse)
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def get_args():
parser = argparse.ArgumentParser(description='Something smart here')
parser.add_argument('my_conf', help='The configuration file for the db', action = FullPaths)
return parser.parse_args()