Skip to content

Instantly share code, notes, and snippets.

View naveensky's full-sized avatar
🎯
SearchTap | www.searchtap.io

Naveen Gupta naveensky

🎯
SearchTap | www.searchtap.io
View GitHub Profile
@donnoman
donnoman / gist:1643445
Created January 19, 2012 22:41
God Init Script for Ubuntu/Debian
#! /bin/sh
### BEGIN INIT INFO
# Provides: god
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: God initscript
### END INIT INFO
@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@dk8996
dk8996 / HTTPSRedirectFilter.scala
Last active June 25, 2017 20:53
Play Framework Filter for AWS Elastic Load Balancer (forward HTTP to HTTPS)
import com.typesafe.scalalogging.slf4j.Logging
import play.api.mvc._
import scala.concurrent.Future
import play.mvc.Results._
import play.api.libs.concurrent.Execution.Implicits.defaultContext
object HTTPSRedirectFilter extends Filter with Logging {
def apply(nextFilter: (RequestHeader) => Future[SimpleResult])(requestHeader: RequestHeader): Future[SimpleResult] = {
//play uses lower case headers.