Skip to content

Instantly share code, notes, and snippets.

View kuFEAR's full-sized avatar

Nikita Karnaukh kuFEAR

  • Revolut
  • Berlin
  • 16:11 (UTC +02:00)
View GitHub Profile
@kuFEAR
kuFEAR / CustomJacksonArrayDeserializer.java
Last active September 7, 2015 11:09
Jackson Deserializer for a primitive JSON array like this {"photos": ["http://www.url.com/img.jpg", "http://www.url.com/img.jpg", "http://www.url.com/img.jpg"] } to using it with Realm
/*
* Created by Nikita Karnaukh on 07/09/15.
*/
public class CustomArrayDeserializer extends JsonDeserializer<RealmList<UserPhoto>> {
@Override
public RealmList<UserPhoto> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
RealmList<UserPhoto> photos = new RealmList<>();
while (true) {
String value = jp.nextTextValue();
@kuFEAR
kuFEAR / ImagePHash.java
Created September 2, 2015 18:07
Android image phash comparing
package com.example.app;
import android.graphics.*;
import android.util.Log;
/*
* pHash-like image hash.
* Author: Elliot Shepherd ([email protected]
* Based On: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
*/
@kuFEAR
kuFEAR / GSImportExport
Last active August 29, 2015 14:22
Script to import/export translate resources into mobile platforms (using Google sheets and Google Script)
function onOpen()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var entries1 = [ {name: "Export to mobile resources(Android, iOS)", functionName: "exportTranslates"}];
ss.addMenu("Export to mobile resources(Check your Google Drive)", entries1);
// Danger for now =) just update current spreadsheet
// var entries = [ {name: "Import from Android XML", functionName: "importFromAndroidXml"}];
// ss.addMenu("Import from Android XML", entries);
}