Skip to content

Instantly share code, notes, and snippets.

View GregorBlock's full-sized avatar

Gregor Block GregorBlock

View GitHub Profile
@Carleslc
Carleslc / factorial.kt
Created March 15, 2018 03:56
Factorial in Kotlin
/** If high-performance is needed consider using Guava BigIntegerMath.factorial instead **/
fun Long.factorial(): BigInteger {
fun factorial(start: Long, n: Long): BigInteger {
var i: Long
if (n <= 16) {
var r = BigInteger.valueOf(start)
i = start + 1
while (i < start + n) {
r = r.multiply(BigInteger.valueOf(i))
i++
@Pulimet
Pulimet / AdbCommands
Last active May 5, 2025 23:59
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active May 2, 2025 11:53
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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
@craSH
craSH / Password.java
Last active June 12, 2024 05:13
A simple example Java class to safely generate and verify bcrypt password hashes for use in authentication systems.
/**
* Author: Ian Gallagher <[email protected]>
*
* This code utilizes jBCrypt, which you need installed to use.
* jBCrypt: http://www.mindrot.org/projects/jBCrypt/
*/
public class Password {
// Define the BCrypt workload to use when generating password hashes. 10-31 is a valid value.
private static int workload = 12;