Skip to content

Instantly share code, notes, and snippets.

@ondrej-kvasnovsky
ondrej-kvasnovsky / gist:ea7c76098f7b13eb4fe2469836b0e278
Last active November 4, 2020 17:42
JSON mapping to SQL where conditions
JSON format:
[
"AND",
["GE", ["column", "Price"], 10],
["EQ", ["column", "Product"], "iPhone"],
["NOT",
[
"OR",
["GE", ["column", "Discount"], 1000],
@ondrej-kvasnovsky
ondrej-kvasnovsky / Search.java
Created February 7, 2017 06:23
Search.java
package com.kangoapp.view.search;
import java.util.ArrayList;
import java.util.List;
import java.util.function.IntPredicate;
import java.util.stream.IntStream;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
/**
@ondrej-kvasnovsky
ondrej-kvasnovsky / History.java
Last active February 5, 2017 19:08
History Manager (undo / redo)
package com.kangoapp.view.history;
import java.util.ArrayDeque;
import java.util.Deque;
public class History<ENTITY> {
private Deque<ENTITY> backStack = new ArrayDeque<>();
private Deque<ENTITY> forwardStack;
private ENTITY current;
//
// HomeController.swift
// PokeMath
//
// Created by Ondrej Kvasnovsky on 11/19/16.
// Copyright © 2016 Ondrej Kvasnovsky. All rights reserved.
//
import Foundation
import UIKit
//: Playground
import UIKit
// we can use semicolons
let cat = "🐱"; print(cat)
// integer
print(UInt8.min)
print(UInt8.max)
@ondrej-kvasnovsky
ondrej-kvasnovsky / playground1.swift
Last active January 29, 2016 06:58
Playground 1 for Swift
//: Playground
import UIKit
// variable
var str = "Hello, playground"
print(str)
@ondrej-kvasnovsky
ondrej-kvasnovsky / test.sh
Last active October 30, 2015 20:54
Test Java 1.8.0_51 and 1.8.0_60 with otool
~ cd /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre/lib
~ otool -L libjfxwebkit.dylib | grep icu
# nothing is found
~ cd /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib
~ otool -L libjfxwebkit.dylib | grep icu
/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 51.1.0)
~ cd /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib
~ otool -L libjfxwebkit.dylib | grep icu
@ondrej-kvasnovsky
ondrej-kvasnovsky / rejection.md
Last active October 22, 2015 05:51
Apps that use non-public APIs will be rejected

October 18, 2015 at 5:29 PM

From Apple

2.5 - Apps that use non-public APIs will be rejected

The use of non-public APIs can lead to a poor user experience should these APIs change in the future, and is therefore not permitted. The following non-public APIs are included in your application:

From the framework: '/usr/lib/libicucore.A.dylib'

  • ubrk_getRuleStatus
@ondrej-kvasnovsky
ondrej-kvasnovsky / questions.txt
Created July 28, 2015 17:26
Software Craftsman Questions
Are we missing big pictue?
Are we missing the goal and crucial features of application?
Are we talking too much about big picture, goals, crucial features? Maybe we should just do it.