Skip to content

Instantly share code, notes, and snippets.

View ohmrefresh's full-sized avatar
😀

Ohm ohmrefresh

😀
  • Bangkok, Thailand
View GitHub Profile
@ohmrefresh
ohmrefresh / gist:85328554cb3cd7b6a6f5
Created September 30, 2014 03:46
Fix Composer Update[Cannot allocate memory]
PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory
1.Delete composer cache:
sudo rm -R ~/.composer
2.Delete vendor folder:
sudo rm -R vendor
3.Rebuild the vendor packages:
composer update
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ScalableImageView extends ImageView {
public boolean isMeasured = true;
public ScalableImageView(Context context) {
super(context);
@ohmrefresh
ohmrefresh / TopCropImageView.java
Last active August 29, 2015 14:03
TopCropImageView
import android.content.Context;
import android.graphics.Matrix;
import android.util.AttributeSet;
import android.widget.ImageView;
public class TopCropImageView extends ImageView {
public TopCropImageView(Context context, AttributeSet attrs) {
super(context, attrs);
setScaleType(ScaleType.MATRIX);
@ohmrefresh
ohmrefresh / gist:55149f68c41a148ae673
Created April 30, 2014 02:52
How to Server-side verification of Google Play subscriptions
1.create google app (google console)
Example:
Client ID xxx.apps.googleusercontent.com
Email address [email protected]
Client secret xxx
Redirect URIs
https://localhost/oauth2callback
Javascript Origins
https://localhost