Skip to content

Instantly share code, notes, and snippets.

View dzeikei's full-sized avatar

James Kim dzeikei

  • Sydney
  • 23:45 (UTC +10:00)
View GitHub Profile
@dzeikei
dzeikei / tech_task.md
Created June 14, 2018 01:55
Technical Task

Weather Observations

Build a tool to mine the logs of a weather balloon for important information.

Requirements

There is a weather balloon traversing the globe, periodically taking observations. At each observation, the balloon records the temperature

package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
@dzeikei
dzeikei / verify_receipt.sh
Last active November 24, 2020 10:36
Verify Google Play In-app billing receipt in command line using OpenSSL
# Convert base64 string from Google to a pem file
openssl enc -base64 -d -in publickey.base64 -A | openssl rsa -inform DER -pubin > public.pem
# Decode base64 signature to binary
openssl base64 -d -A -in signature.txt -out signature.sha1
# Verify signature
openssl dgst -sha1 -verify public.pem -signature signature.sha1 receipt.json
@dzeikei
dzeikei / SSLPinning
Last active December 15, 2015 23:39
Get public key from a HTTPS server
Grab the certificate from the HTTPS server (e.g. Google)
$ openssl s_client -connect google.com:443
Generate a Java keystore from certificate
$ wget http://bouncycastle.org/download/bcprov-jdk16-146.jar
$ keytool -importcert -file your_signing_certificate.pem -keystore app.keystore -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath bcprov-jdk16-146.jar -storetype BKS
@dzeikei
dzeikei / GPUImageSwirlFilter.java
Created February 26, 2013 02:12
GPUImageSwirlFilter
/*
* Copyright (C) 2012 CyberAgent
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dzeikei
dzeikei / RoundedImageView.java
Created December 3, 2012 00:44
Android Rounded ImageView without modifying the original bitmap. Best used with ScaleType.CENTER_CROP or ScaleType.FIT_XY
package com.snepo.common.widgets;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.graphics.Path.FillType;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;