Skip to content

Instantly share code, notes, and snippets.

View ovitrif's full-sized avatar
:octocat:
₿e honourable 🎩

Ovi Trif ovitrif

:octocat:
₿e honourable 🎩
View GitHub Profile
enum class Sport { HIKE, RUN, TOURING_BICYCLE, E_TOURING_BICYCLE }
data class Summary(val sport: Sport, val distance: Int)
fun main() {
val sportStats = listOf(
Summary(Sport.HIKE, 92),
Summary(Sport.RUN, 77),
Summary(Sport.TOURING_BICYCLE, 322),
Summary(Sport.E_TOURING_BICYCLE, 656)
// ==UserScript==
// @name Expose `setThemeColor` window function to color toolbar of Chrome PWAs
// @namespace http://tampermonkey.net/
// @version 0.1
// @description A simple script to make it easier to set the appbar of Chrome apps via a small running after it.
// @author @ovitrif
// @match https://*/*
// @icon none
// @grant none
// ==/UserScript==
/* ovi-typora-theme [https://gist.github.com/ovitrif/16991334750c6d05509409fd25804a46] */
:root {
--bg-color: #1d1d1d;
--side-bar-bg-color: #1f1f1f;
--control-text-color: #999;
--select-text-bg-color: hsl(153, 47%, 40%);
--select-text-font-color: #fff;
--item-hover-bg-color: #fff;
@ovitrif
ovitrif / get-latest-tag-on-git.sh
Created January 22, 2018 09:39 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
// SmoothScroll v0.9.9
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi: maintainer (CHANGELOG.txt)
// - Patrick Brunner ([email protected])
// - Michael Herf: ssc_pulse Algorithm
$ = jQuery.noConflict();
function ssc_init(){if(!document.body)return;var e=document.body;var t=document.documentElement;var n=window.innerHeight;var r=e.scrollHeight;ssc_root=document.compatMode.indexOf("CSS")>=0?t:e;ssc_activeElement=e;ssc_initdone=true;if(top!=self){ssc_frame=true}else if(r>n&&(e.offsetHeight<=n||t.offsetHeight<=n)){ssc_root.style.height="auto";if(ssc_root.offsetHeight<=n){var i=document.createElement("div");i.style.clear="both";e.appendChild(i)}}if(!ssc_fixedback){e.style.backgroundAttachment="scroll";t.style.backgroundAttachment="scroll"}if(ssc_keyboardsupport){ssc_addEvent("keydown",ssc_keydown)}}function ssc_scrollArray(e,t,n,r){r||(r=1e3);ssc_directionCheck(t,n);ssc_que.push({x:t,y:n,lastX:t<0?.99:-.99,lastY:n<0?.99:-.99,start:+(new Date)});if(ssc_pending){return