Skip to content

Instantly share code, notes, and snippets.

Text(
"The key idea is your requirements doc is your source of truth, not your tickets. You create units of" +
" work based on the doc. Edits are versioned and create new units of work. You can get context on" +
" anything you are working on by 'zooming out' to where it is in your docs."
)
val Features = listOf(
Feature(
"Document",
"The primary view of your requirements. Lets you see the current 'state of the world' in one" +
@evant
evant / SnapTopLinearLayoutManager.java
Created July 16, 2015 19:33
Force item to top instead of just on screen when smooth scrolling with RecyclerView
public class SnapTopLinearLayoutManager extends LinearLayoutManager {
public SnapTopLinearLayoutManager(Context context) {
super(context);
}
public SnapTopLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
@evant
evant / advent1.sparkle
Created December 7, 2021 18:47
Advent of Code 1a
Dear Princess Celestia: Advent of Code 1.
Today I learned how to calculate how quickly my submarine depth increases.
Did you know that the found depths have the numbers 0 and 0?
Did you know that the number of measurements is a number?
Did you know that the last measurement was a number?
Here's what I did,
I heard the last measurement.
// cue export --out text fizzbuzz.cue
import "strings"
_numbers: [1,2,3,4,5,6,7,8,9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
@evant
evant / AppBackgroundChecker.java
Created September 3, 2015 14:04
Check when app is in forground/background (api 14+)
public class AppBackgroundChecker implements Application.ActivityLifecycleCallbacks, ComponentCallbacks2 {
private boolean isBackground;
public void register(Application application) {
application.registerActivityLifecycleCallbacks(this);
application.registerComponentCallbacks(this);
}
@Override
@evant
evant / README.md
Created November 29, 2016 21:04
RxDiffUtil

Usage

Given a stream of collection of items to show, provide a diff callback which determines the size and differences in that collection.

Observable<List<String>> observable1 ...;
observable1.compose(RxDiffUtil.diff(new RxDiffUtil.Callback<List<String>>() {
    @Override
    public int getSize(List<String> list) {
        return list.size();
 }
@evant
evant / code-review
Last active August 2, 2017 11:51
A ruby script to automatically create crucible reviews based on your current branch and youtrack ticket.
#!/usr/bin/env ruby
# A script to create a review on crucible based on the current git branch and
# youtrack ticket.
#
# To configure settings, create a file named .code-review in your home directory
# The format should be:
# ------------------------------------------------------------------------------
# crucible:
# url: <crucible url>
# username: <username>

Keybase proof

I hereby claim:

  • I am evant on github.
  • I am evant (https://keybase.io/evant) on keybase.
  • I have a public key ASCeFjmQU8VV-Elouees8rKTCkk8tO7qjDFQBzL1J3umqgo

To claim this, I am signing this object:

@evant
evant / EvictableSingleCache.java
Last active May 14, 2017 17:03
A single cache that allows evicting the value or error. Subscriptions after the value is evicted will re-trigger the upstream observer.
/**
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
@evant
evant / gist:ab9a06194a5d910b7f13
Last active December 27, 2016 17:59
Proxy okhttp
OkHttpClient client = new OkHttpClient();
Proxy proxy = new Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved("192.168.1.105", 8081);
client.setProxy(proxy);