Skip to content

Instantly share code, notes, and snippets.

View NaikSoftware's full-sized avatar
🇺🇦

Nickolay Savchenko NaikSoftware

🇺🇦
  • Ukraine
View GitHub Profile
@NaikSoftware
NaikSoftware / USAGE.dart
Last active May 12, 2022 14:17
Repository design pattern for Dart
// Setup repository with parameters
_userRepository = StreamRepository(
fetch: (key, arguments) => _api.getUser(userId: key),
storageKey: 'users',
decode: (json) => UserDto.fromJson(json),
cacheDuration: const Duration(days: 1),
);
// Get data stream
Stream<Resource<UserDto>> getUser({
@NaikSoftware
NaikSoftware / INPUT.TXT
Last active September 24, 2019 06:42
Working Days Lab
4
15.01. 17:00
16.01. 12:00
11.02. 14:00
30.01. 10:00
@NaikSoftware
NaikSoftware / AndroidManifest.xml
Created January 22, 2019 14:24
Android: Retrieve city from current device location
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ua.naiksoftware.citynametester">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -i input.flv -vf "$filters,palettegen" -y $palette
ffmpeg -i input.flv -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y output.gif
#!/usr/bin/python
import colorsys
import getopt
from tempfile import NamedTemporaryFile
import sys
from wand.image import Image
import os
@NaikSoftware
NaikSoftware / NestedCoordinatorLayout.java
Last active September 5, 2018 09:40 — forked from karthikrg/gist:0948bf5d7864c0376bcd
Coordinator layout that supports nesting of other coordinator layouts within
package android.support.design.widget;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.NestedScrollingChildHelper;
import android.util.AttributeSet;
import android.view.View;
/**