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
git clone https://github.com/git/git | |
cp git/contrib/completion/git-completion.bash ~/git-completion.sh | |
cp git/contrib/completion/git-prompt.sh ~/git-prompt.sh |
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
source $HOME/git-completion.sh | |
source $HOME/git-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE=true | |
txtylw='\033[1;33m' # Yellow | |
fgcolor="\033[0m" # unsets color to term's fg color | |
twolevelprompt='$([ "$PWD" != "${PWD%/*/*/*}" ] && echo "/...${PWD##${PWD%/*/*}}" || echo "$PWD")' | |
gitprompt='$(__git_ps1 "[%s]")' | |
export PS1="\[$txtylw\] $twolevelprompt\[$fgcolor\]$gitprompt"'\$ ' |
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
<%@ page import="java.lang.management.*" %> | |
<%@ page import="java.util.*" %> | |
<html> | |
<head> | |
<title>JVM Memory Monitor</title> | |
</head> | |
<body> | |
<% | |
Iterator iter = ManagementFactory.getMemoryPoolMXBeans().iterator(); |
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
pear channel-discover pear.pdepend.org | |
pear channel-discover pear.phpmd.org | |
pear channel-discover pear.phpunit.de | |
pear channel-discover components.ez.no | |
pear channel-discover pear.symfony-project.com | |
pear install pdepend/PHP_Depend | |
pear install phpmd/PHP_PMD | |
pear install phpunit/phpcpd | |
pear install phpunit/phploc |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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/bash | |
## Node.js App Launcher | |
## Usage: ./nodedaemon.sh /home/apps/projectname/app.js | |
## Baesed on: http://pastebin.com/wNJNkbjg | |
# name=`basename $1` # For when/if we want to use scriptname | |
name=`dirname $1 | xargs -0 basename` # When/if we want to use last folder name as project name | |
cd `dirname $1` |
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 | |
### | |
# Accepts 1 or 2 as argument (Order # of Tomcat server to work with) | |
### | |
function checkCatalina(){ | |
if [[ $# -ne 1 ]]; then | |
echo -1 && return | |
fi | |
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 php -q | |
<?php | |
/** | |
* Copied with minor fixes from: http://www.jezra.net/blog/proof_of_concept_webserver_written_in_PHP | |
*/ | |
date_default_timezone_set('America/New_York'); | |
//function get_include_contents |
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
dso.search = function() { | |
var data = false; | |
var search = $('#search'); | |
var template = _.template('<li><a href="<%=url%>"><span class="title"><%=title%></span><small><%=subtitle%></small><small class="date"><%=date%></small></a></li>'); | |
var find = function(phrase) { | |
if (!data) return $.ajax({ | |
url: '/search.json', | |
dataType: 'json', | |
success: function(resp) { | |
data = _(resp).chain() |
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 dateToArray(ts, length, utc) { | |
var length = length || 6, | |
d = new Date(ts), | |
utc = Boolean(local) || true; | |
if (utc) { | |
return [d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()].slice(0, length); | |
} else { | |
return [d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()].slice(0, length); | |
} |
OlderNewer