Skip to content

Instantly share code, notes, and snippets.

View neworld's full-sized avatar
🇱🇹
Programming

Andrius Semionovas neworld

🇱🇹
Programming
  • Vinted
  • Vilnius, Lithuania
View GitHub Profile
data Tree a = Empty | Tree a (Tree a) (Tree a) deriving (Show)
singleton :: a -> Tree a
singleton x = Tree x Empty Empty
addToTree :: (Ord a) => a -> Tree a -> Tree a
addToTree new Empty = singleton new
addToTree new (Tree value left right)
| new < value = Tree value (addToTree new left) right
| otherwise = Tree value left (addToTree new right)
@neworld
neworld / TimedDynamicText.java
Created January 17, 2017 12:47
TimedDynamicText
public class TimedDynamicText extends SpannableStringBuilder {
private final ArrayDeque<Pair<Integer, CharSequence>> list;
private Handler handler = new Handler();
private CharSequence nextText = "";
public TimedDynamicText(CharSequence initialText, Collection<Pair<Integer, CharSequence>> list) {
this.list = new ArrayDeque<>(list);
nextText = initialText;
next();
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
package com.vinted.extensions
import kotlin.reflect.KProperty
/**
* @author Andrius Semionovas
* @since 2015-10-16
*/
class LazyVar<T> internal constructor(initializer: () -> T) {