Skip to content

Instantly share code, notes, and snippets.

View Fi5t's full-sized avatar
☝️
Every software architect is a developer but not every developer is an architect

Fi5t

☝️
Every software architect is a developer but not every developer is an architect
View GitHub Profile
import json
from pprint import pprint
json_data = open('releases.json')
data = json.load(json_data)
for dateString in data["list"]:
print(dateString["date"]["russia"]["string"])
json_data.close()
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 18
versionCode 1
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 8
targetSdkVersion 15
versionCode 1
versionName "1.0"
def unicodeToString(unicodeString: String): String = {
val unicodeChars = unicodeString.split("""\\u""").filter(!_.isEmpty)
unicodeChars.map(Integer.parseInt(_, 16).toChar).mkString
}
@Fi5t
Fi5t / module_build.gradle
Created February 26, 2015 13:06
DBFlow with Gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "ru.freedomlogic.dbflower"
minSdkVersion 15
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "ru.freedomlogic.hellowatch"
@Fi5t
Fi5t / Joiner.java
Last active August 29, 2015 14:21
Join collection of strings into comma-separated string
public static String join(String separator, Iterator<String> iterator) {
StringBuilder builder = new StringBuilder();
while (iterator.hasNext()) {
String token = iterator.next();
if (token != null && !token.isEmpty()) {
builder.append(token);
break;
}
}
final Scheduler scheduler = Schedulers.from(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()));
Observable.just("1", "2", "3", "4", "5")
.flatMap(id -> loadFileById(scheduler, id))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(s2 -> hello.setText(hello.getText() + "\n" + s2));
private Observable<String> loadFileById(final Scheduler scheduler, final String id) {
return Observable.defer(
() -> Observable.just(id)
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionModeOverlay">true</item>
<item name="actionModeStyle">@style/ActionModeStyle</item>