This file contains hidden or 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
# Exec | |
composer global require '{APP PACKAGE}' | |
# Example | |
composer global require 'phpunit/phpunit=3.7.*' |
This file contains hidden or 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 rev-parse HEAD |
This file contains hidden or 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
$pdo = new PDO( 'mysql:dbname={DBNAME};host=localhost', $user, $pass ); |
This file contains hidden or 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
tail -f logfile.log | while read LOGLINE | |
do | |
[[ "${LOGLINE}" == *"Server Started"* ]] && pkill -P $$ tail && {DO SOMETHING HERE} | |
done |
This file contains hidden or 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
// Initial Setup - Get AUTH TOKEN from ngrok.com (Run this once) | |
ngrok -authtoken {AUTH TOKEN} 80 | |
// Run Ngrok on a specific Subdomain (Ex: local.ngrok.com) | |
ngrok -subdomain=local 8080 |
This file contains hidden or 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
// Interface | |
public interface FooBar<T> { | |
// ... | |
} | |
// Impl Class | |
public class BarFoo implements FooBar<Person> { | |
// ... | |
} |
This file contains hidden or 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
/* | |
* Implement the java.lang.Iterable<E> interface | |
*/ | |
public class MyCollection<E> implements Iterable<E>{ | |
public Iterator<E> iterator() { | |
return new MyIterator<E>(); | |
} | |
} |
This file contains hidden or 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
// Array of StackTraceElements | |
Thread.currentThread().getStackTrace(); | |
// Return as String, (Uses Apache Commons Lib) | |
String fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(e); | |
// Get Defined Position of Current Method | |
(new Throwable()).getStackTrace(); |
This file contains hidden or 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
######################################################### | |
# Step 1 - Create /etc/init.d/{service-name} File | |
######################################################### | |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: service-name | |
# Short-Description: Management of {Service Name} | |
### END INIT INFO | |
This file contains hidden or 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
System.out.println("##################\n Relevant Stack\n##################"); | |
for(StackTraceElement stackelement : Thread.currentThread().getStackTrace()){ | |
String[] elementClass = stackelement.getClassName().split("\\."); | |
// Set Relevant Packages Here (com by default) | |
if( elementClass.length > 3 && elementClass[0].equals("com") ) { | |
System.out.println( stackelement.getClassName() + " :: " + stackelement.getMethodName() + "()"); | |
} | |
} | |
System.out.println("##################\n [end] Relevant Stack\n##################\n\n"); |