Skip to content

Instantly share code, notes, and snippets.

View glush's full-sized avatar

Slava Glushenkov glush

  • Minsk, Belarus
View GitHub Profile
@ravidsrk
ravidsrk / coloredLogcat.md
Created February 8, 2016 15:55 — forked from marcjubero/coloredLogcat.md
Colored Logcat - Android Studio

#####Logcat Colors for IntelliJ Darcula Theme (original post)

  • Preferences -> Editor -> Android Logcat
  • "Save As" scheme
  • Uncheck "Use inherited attributes" option
  • Edit foreground color with the following
Debug   : #6897BB 
Info : #6A8759 
@passsy
passsy / KIntent.kt
Last active March 28, 2023 06:51
Kotlin extension functions to start a generic Activity
package com.pascalwelsch.extensions
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
/**
* Extensions for simpler launching of Activities
@aveuiller
aveuiller / packageAndroid.sh
Last active May 12, 2024 14:38
Extract the Android .odex files and package a new android.jar with the retrieved classes
#!/bin/sh
##
# Usage:
# ./convert.sh /path/to/framework /path/to/out $apiVersion $arch
#
# $arch is mandatory only in case of an ART system and defines the boot folder to use (arm, x86, x86_64).
##
frameworkDir=$1
# Final output directory
@ValCanBuild
ValCanBuild / BottomNavigationBehavior.kt
Last active December 18, 2023 00:04
Full code of a BottomNavigationBehavior which hides itself on scroll and handles Snackbars, FAB and snapping. https://medium.com/@ValCanBuild/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e
/**
MIT License
Copyright (c) 2018 Valentin Hinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@GokhanArik
GokhanArik / NetworkStateManager.kt
Created March 12, 2020 03:11
Check Internet Connection in Android 21+
package manager
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import android.os.Build
import android.util.Log
import com.jakewharton.rxrelay2.BehaviorRelay
@cedrickring
cedrickring / ColoredShadow.kt
Last active June 24, 2024 10:26
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
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,
@cyrenity
cyrenity / compile-and-install-freeswitch-1.10.x-on-ubuntu.md
Last active July 20, 2024 03:08
Install FreeSWITCH 1.10.x on Ubuntu 18.04 | 20.04 | 22.04 LTS

Installing FreeSWITCH 1.10.X on Ubuntu 18.04 | 20.04 | 22.04 LTS

Introduction

FreeSWITCH is a software defined telecom stack that runs on any commodity hardware. FreeSWITCH can handle voice, video and text communication and support all popullar VoIP protocols. FreeSWITCH is flexible and modular, and can be used in any way you can imagine

This guide demonstrates how to get it install FreeSWITCH and get it up and running on a Ubuntu 20.04 LTS machine

Prerequisites

To follow along with this guide, you need one Ubuntu 20.04 LTS server which has prerequisite packages installed and configured. In order to install required packages issue following command

@denis-ismailaj
denis-ismailaj / WormPageIndicator.kt
Last active August 21, 2023 11:24
Animated worm page indicator composable for Jetpack Compose
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.requiredWidth
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.CornerRadius
@surajsau
surajsau / DragDropList.kt
Last active January 14, 2024 13:05
Drag-n-Drop implementation in Jetpack Compose
@Composable
fun DragDropList(
items: List<ReorderItem>,
onMove: (Int, Int) -> Unit,
modifier: Modifier = Modifier
) {
val scope = rememberCoroutineScope()
var overscrollJob by remember { mutableStateOf<Job?>(null) }