Skip to content

Instantly share code, notes, and snippets.

View rozag's full-sized avatar

Alexey Mileev rozag

  • Earth
View GitHub Profile
@rozag
rozag / feeds-tech.json
Last active March 4, 2024 11:50
Tech source for the rss-tg-chan project.
{
"feeds": [
"https://medium.com/feed/android-news",
"http://akarnokd.blogspot.com/feeds/posts/default",
"http://feeds.feedburner.com/GoogleOpenSourceBlog",
"http://feeds.feedburner.com/BenNorthrop",
"http://os.phil-opp.com/atom.xml",
"http://dev.cheremin.info/feeds/posts/default",
"http://feeds.feedburner.com/blogspot/hsDu",
"http://ruhaskell.org/feed.xml",
@rozag
rozag / SingleEventLiveData.java
Created June 6, 2018 16:45
A lifecycle-aware LiveData that sends only new updates after subscription, used for events like navigation and Snackbar messages.
/**
* A lifecycle-aware observable that sends only new updates after subscription, used for events like
* navigation and Snackbar messages.
* <p>
* This avoids a common problem with events: on configuration change (like rotation) an update
* can be emitted if the observer is active. This LiveData only calls the observable if there's an
* explicit call to setValue() or call().
* <p>
* Note that only one observer is going to be notified of changes.
*/
@rozag
rozag / feeds-news.json
Last active March 2, 2021 13:57
News source for the rss-tg-chan project.
{
"feeds": [
"http://umneem.org/index.xml",
"https://nplus1.ru/rss",
"https://nplusonemag.com/feed/",
"http://disgustingmen.com/feed/",
"http://gorky.media/feed/",
"https://thenextweb.com/feed/"
]
}
@rozag
rozag / index.html
Last active February 4, 2021 18:09
Простой фрактал на JavaScript
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>SimpleFractal</title>
</head>
<body>
<canvas width="900" height="600"></canvas>
</body>
@rozag
rozag / purge-dot-idea.sh
Created March 10, 2019 13:33
Script to drop a bunch of Intellij IDEA caches
#!/usr/bin/env bash
set -x
rm -rv .idea/caches
rm -rv .idea/libraries
rm -v .idea/gradle.xml
rm -v .idea/modules.xml
@rozag
rozag / sticker.txt
Created March 4, 2019 13:21
@shitty_android PeerLab sticker idea
____________
| itty |
| android |
| peerlab |
| ./sh |
‾‾‾‾‾‾‾‾‾‾‾‾
private static final int SECOND_MILLIS = 1000;
private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS;
private static final int HOUR_MILLIS = 60 * MINUTE_MILLIS;
private static final int DAY_MILLIS = 24 * HOUR_MILLIS;
public static String getTimeAgo(long time, Context context) {
if (time < 1000000000000L) {
// if timestamp given in seconds, convert to millis
time *= 1000;
}
@rozag
rozag / BenchmarkUtil.java
Last active July 5, 2018 11:48
A dummy benchmark helper
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public final class BenchmarkUtil {
private static final List<Long> TIMES = new ArrayList<>(10);
private static long startNanos;
@rozag
rozag / Pair.java
Created June 6, 2018 11:06
An example of object pool implementation
public final class Pair {
public int firstValue;
public int secondValue;
// Reference to next object in the pool
private Pair next;
// The lock used for synchronization
private static final Object sPoolSync = new Object();
@rozag
rozag / keybase.md
Created April 19, 2017 15:50
Verifying myself on keybase.io

Keybase proof

I hereby claim:

  • I am rozag on github.
  • I am rozag (https://keybase.io/rozag) on keybase.
  • I have a public key ASARItueGmMr-u_4jpmjgnAWrp82xuI_vKQztwqAK3KADAo

To claim this, I am signing this object: