Skip to content

Instantly share code, notes, and snippets.

View mushfek's full-sized avatar

Mushfekur Rahman mushfek

View GitHub Profile
@mushfek
mushfek / set_jdk.sh
Created December 13, 2015 14:59
Set JDK in bash profile in OS X
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
<source>
type tail
format apache2
path /var/log/apache2/access.log #This is the location of your Apache log
tag apache.access
</source>
<match apache.access>
type grepcounter
count_interval 60 #Time window to grep and count the # of events
/* *******************************************
// LICENSE INFORMATION
// The code, "Detecting Smartphones Using PHP"
// by Anthony Hand, is licensed under a Creative Commons
// Attribution 3.0 United States License.
//
// Updated 01 March 2010 by Bryan J Swift
// - Remove un-needed if statements instead just returning the boolean
// inside the if clause
//
{
"Students": [
{
"Name": "Harry",
"Subject": "maths"
},
{
"Name": "Ryan",
"Subject": "Biology"
},