Skip to content

Instantly share code, notes, and snippets.


Libin Bensin libinbensin

View GitHub Profile
libinbensin /
Created May 29, 2016 — forked from wh1tney/
How to deploy a static website to Heroku


This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

libinbensin /
Created Oct 31, 2015 — forked from bitops/
A drop-in replacement for a MediaPlayer instance, that provides an accessor for the current state.
import java.lang.reflect.Method;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
libinbensin / card_layout
Created Sep 23, 2015 — forked from biokys/card_layout
Card layout with bottom shadow
View card_layout
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="">
<shape android:shape="rectangle"
<corners android:radius="@dimen/card_corner_radius"/>
<solid android:color="#bbb" />
View InstallTomcat
Here are the easy to follow steps to get it up and running on your Mac
Download a binary distribution of the core module: apache-tomcat-7.0.47.tar.gz from here. I picked the tar.gz in Binary Distributions / Core section.
Opening/unarchiving the archive will create a folder structure in your Downloads folder: (btw, this free Unarchiver app is perfect for all kinds of compressed files and superior to the built-in Archive
Open to Terminal app to move the unarchived distribution to /usr/local
sudo mkdir -p /usr/local
sudo mv ~/Downloads/apache-tomcat-7.0.47 /usr/local
libinbensin / StartTomcat.txt
Last active Aug 29, 2015
Start Apache Tomcat at boot on Mac OS X
View StartTomcat.txt
This is for installing tomcat as a daemon on port 8080 but enable also port 80 by using a firewall redirection.
Edit /Library/Tomcat/conf/server.xml and add proxyport="80" URIEncoding="UTF-8" inside <Connector .../>.
<Connector proxyport="80" URIEncoding="UTF-8" />
Assign enough memory to the Java machine or you may be in trouble later. Inside /Library/Tomcat/conf/local.env
export JAVA_OPTS="-Xmx3000M -Xms3000M -Djava.awt.headless=true -Duser.timezone=UTC"
* Copyright 2014 Chris Banes
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
View SlidingUpPanelView
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
View strip_play_services.gradle
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
return result
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
libinbensin /
Created May 9, 2014
HorizontalListView to add items horizontally
import android.content.Context;
import android.database.DataSetObserver;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Adapter;
import android.widget.BaseAdapter;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
libinbensin / AndroidManifest.xml
Created May 9, 2014
Widget with Service (Custom Action)
View AndroidManifest.xml
/** change the service in manifest to receive custom action **/
<service android:name="" >
<action android:name="" />
<category android:name="android.intent.category.DEFAULT" />