Skip to content

Instantly share code, notes, and snippets.

View angeloh's full-sized avatar
🎯
Focusing

Angelo Huang angeloh

🎯
Focusing
View GitHub Profile
@angeloh
angeloh / brew-sbt
Created July 6, 2012 21:56
brew install sbt
$ brew versions sbt
$ git checkout 785f6f8 /usr/local/Library/Formula/sbt.rb
$ brew unlink sbt (if you have old verion, you might need this)
$ brew install sbt
@angeloh
angeloh / my model
Created August 24, 2012 04:43
ImageInfo.java
package models;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@angeloh
angeloh / ImagePost.java
Created August 24, 2012 05:02
part of routes
package controllers;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Callable;
@angeloh
angeloh / shopinionPlugin.js
Created September 9, 2012 22:02
shopinionPlugin.js
var SHOPINION_DOMAIN="a.shopinionapp.com"; // either "j." or "" for j.shopinionapp.com or shopinionapp.com
var friends = null;
var friendsName = [];
var loadingPusher=false;
var xhr;
var head = document.getElementsByTagName('head')[0];
var initialized = false;
var counter = 0;
var idList = new Array();
@angeloh
angeloh / shopinionPlugin.js
Created September 10, 2012 20:15
shopinionPlugin.js
var SHOPINION_DOMAIN="a.shopinionapp.com"; // either "j." or "" for j.shopinionapp.com or shopinionapp.com
var friends = null;
var friendsName = [];
var loadingPusher=false;
var xhr;
var head = document.getElementsByTagName('head')[0];
var initialized = false;
var counter = 0;
var idList = new Array();
@angeloh
angeloh / MyLoggerJ.java
Created November 13, 2012 00:06
MyLoggerJ.java to use with MyLoggerS.scala
package common;
import play.Logger.ALogger;
import play.api.Play;
public class MyLoggerJ {
private static final BLogger logger = of("application");
/**
@angeloh
angeloh / gist:4076603
Created November 15, 2012 04:19
smack code for fb chat
SASLAuthentication.registerSASLMechanism(SASLXFacebookPlatformMechanism.NAME, SASLXFacebookPlatformMechanism.class);
SASLAuthentication.supportSASLMechanism(SASLXFacebookPlatformMechanism.NAME, 0);
ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222);
config.setSASLAuthenticationEnabled(true);
config.setDebuggerEnabled(false);
XMPPConnection conn = null;
try {
conn = new XMPPConnection(config);
@angeloh
angeloh / play.conf
Created October 7, 2013 03:55 — forked from leon/play.conf
# Upstart script for a play application that binds to an unprivileged user.
# put this into a file like /etc/init/play.conf
#
# This could be the foundation for pushing play apps to the server using something like git-deploy
# By calling service play stop in the restart command and play-start in the restart command.
#
# Usage:
# start play
# stop play
# restart play
@angeloh
angeloh / gist:e46fb6b903c40ca48508
Last active April 5, 2016 22:10 — forked from tankchintan/gist:1335220
Procedure for installing and setting Sun JDK Java 7 on Default Amazon Linux AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.rpm
# Install Java
sudo rpm -i jdk-7u80-linux-x64.rpm
# Check if the default java version is set to sun jdk
@angeloh
angeloh / nginx.conf
Created July 14, 2016 21:09 — forked from philihp/nginx.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php56-fpm
# Install PHP extensions
sudo yum install -y php56-devel php56-mysql php56-pdo \
php56-pear php56-mbstring php56-cli php56-odbc \