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 / 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 \
@angeloh
angeloh / gist:46e08907cf3a2969e2ed24390a727841
Last active May 1, 2018 05:54
Procedure for installing and setting Sun JDK Java 8 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/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.rpm
# Install Java
sudo rpm -i jdk-8u172-linux-x64.rpm
# Check if the default java version is set to sun jdk
@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 / CameoPatterns.scala
Last active August 29, 2015 14:21
Cameo Patterns
/*
https://www.chrisstucchio.com/blog/2013/actors_vs_futures.html
First, I'd argue that you've excluded Akka's most important use case: Distribution. I would say
"Futures for Concurrency, Actors for State or Distribution." Location transparency is one of
Akka's most important use cases - if you use Actors infront of services, then you can deploy
your application in many discrete micro-services with ease, only changing configuration. For this,
you use actorSelection and pass the path so you can work on the app as one big piece and then
deploy it as 7.
/**
The Play (2.3) json combinator library is arguably the best in the scala world. However it doesnt
work with case classes with greater than 22 fields.
The following gist leverages the shapeless 'Automatic Typeclass Derivation' facility to work around this
limitation. Simply stick it in a common location in your code base, and use like so:
Note: ** Requires Play 2.3 and shapeless 2.1.0
import SWrites._
import SReads._
sina.com
sina.cn
126.com
163.com
yeah.net
vip.sina.com
vip.126.com
vip.21cn.com
qq.com
foxmail.com
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@angeloh
angeloh / variable-property-attributes-or.html
Last active August 29, 2015 14:02
variable property attributes for ios
Credit @http://rdcworld-iphone.blogspot.in/2012/12/variable-property-attributes-or.html
Variable property attributes or Modifiers in iOS
Variable property attributes or Modifiers
Property Attributes Indicate Data Accessibility and Storage Considerations
Use Accessor Methods to Get or Set Property Values
@angeloh
angeloh / index.html
Created May 10, 2014 23:12
realtime-channel javascript demo
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<title>Goodow Realtime Channel API Playground</title>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>