Skip to content

Instantly share code, notes, and snippets.

@jam53
jam53 / CalculatingYouTubeWatchTime.md
Last active October 5, 2023 18:43
A concise guide that outlines the process of calculating ones total watch time on YouTube

Calculating YouTube watch time

Prerequisites

YouTube watch history

Request a copy of your YouTube watch history over at Google Takeout

  • Click on Deselect all
  • Scroll down and select YouTube and YouTube Music
  • Click on All YouTube data included
  • Make sure to only select history
@andrew-raphael-lukasik
andrew-raphael-lukasik / .UIDocumentLocalization.cs.md
Last active December 23, 2024 04:20
Text localization script for UIDocument (UI Toolkit @ Unity)

pattern to follow

// NOTE: this class assumes that you designate StringTable keys in label fields (as seen in Label, Button, etc) // and start them all with '#' char (so other labels will be left be)

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active February 28, 2025 07:02
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@baumato
baumato / EnvironmentalEntityManagerFactory.java
Last active February 19, 2025 12:12
When working with eclipseLink as JPA provider then the EnvironmentalEntityManagerFactory allows to use environment variables in the persistence.xml. This factory should be used instead of Persistence.createEntityManagerFactory.
package com.hlag.fis.test.persistence;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@Col-E
Col-E / SmoothishScrollpane.java
Created June 24, 2018 23:59
JavaFX ScrollPane with smooth scrolling
import javafx.animation.Animation.Status;
import javafx.animation.Interpolator;
import javafx.animation.Transition;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.control.ScrollPane;
import javafx.scene.input.ScrollEvent;
import javafx.scene.layout.VBox;
import javafx.util.Duration;
@marcandreappel
marcandreappel / Android auto increment build number
Created June 11, 2018 14:54
Android Studio auto increment build number for version code
# First create the file version.properties with value VERSION_BUILD=0
# In app/build.gradle:
android {
def versionPropsFile = file('version.properties')
def versionBuild
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
@florina-muntenescu
florina-muntenescu / Data.kt
Last active February 19, 2025 14:28
Using RoomDatabase#Callback to pre-populate the database - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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
@james-d
james-d / AnimatedPropertiesTest.java
Created January 17, 2014 15:08
Some simple examples of animations with a Button
import java.util.concurrent.Callable;
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.RotateTransition;
import javafx.animation.Timeline;
import javafx.application.Application;