Skip to content

Instantly share code, notes, and snippets.

View mushfek's full-sized avatar

Mushfekur Rahman mushfek

View GitHub Profile
{
"Students": [
{
"Name": "Harry",
"Subject": "maths"
},
{
"Name": "Ryan",
"Subject": "Biology"
},
/* *******************************************
// 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
//
<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
@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
}
@mushfek
mushfek / workspace.sh
Created January 6, 2016 15:22 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
<!DOCTYPE html>
<html>
<head>
<title>Compose&nbsp;::&nbsp;SComm</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="libs/jquery-1.11.3/jquery-1.11.3.js"></script>
public class AverageFileSize extends SimpleTagSupport {
private boolean humanReadable;
private List<AttachedFile> fileList;
public AverageFileSize(List<AttachedFile> fileList) {
this.humanReadable = false;
this.fileList = fileList;
}
@mushfek
mushfek / AverageFileSize.java
Created November 10, 2016 05:08
JSP Tag Pooling Memory Leak
public class AverageFileSize extends SimpleTagSupport {
private boolean humanReadable;
private List<AttachedFile> fileList;
public AverageFileSize(List<AttachedFile> fileList) {
this.humanReadable = false;
this.fileList = fileList;
}
@mushfek
mushfek / introrx.md
Created January 2, 2017 06:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
sudo apt-get install \
build-essential flex bison \
libreadline6-dev zlib1g-dev \
libnl1 libssl-dev libnl-dev \
libssl-dev \
libcurl4-gnutls-dev \
libexpat1-dev \
tcl tk \
tcl-dev gettext \
asciidoc \