Skip to content

Instantly share code, notes, and snippets.

View radusalagean's full-sized avatar
☀️

Radu Salagean radusalagean

☀️
View GitHub Profile
@zeroseis
zeroseis / disable-auto-android-file-transfer.md
Created September 14, 2015 17:28
Disable auto start for Android File Transfer
  • Close Android File Transfer
  • Open Activity Monitor and kill “Android File Transfer Agent”
  • Go to where you installed “Android File Transfer.app” (I have it under /Applications)
  • Ctrl+click –> “Show package contents”
  • Go to Contents/Resources
  • Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
  • Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
@alvinthen
alvinthen / opacity.txt
Created July 29, 2016 17:20
Convert opacity values in percentage to hexadecimal
0% - 00
1% - 03
2% - 05
3% - 08
4% - 0A
5% - 0D
6% - 0F
7% - 12
8% - 14
9% - 17
@mort3za
mort3za / git-auto-sign-commits.sh
Last active May 7, 2024 01:45
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@bradtraversy
bradtraversy / sample.md
Created March 23, 2018 18:17
Markdown Cheat Sheet

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This text is italic

@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active May 18, 2024 19:47
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
@dlew
dlew / script.sh
Created November 9, 2018 16:36
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
@martinloesethjensen
martinloesethjensen / StringExtension.kt
Last active May 5, 2024 04:37
Kotlin string extension to apply https prefix to string.
/**
* Adds https prefix if link does not have prefix. It will also change old prefix http to https.
* @return link/url with https prefix
*/
fun String.toHttpsPrefix(): String? = if (isNotEmpty() && !startsWith("https://") && !startsWith("http://")) {
"https://$this"
} else if (startsWith("http://")) {
replace("http://", "https://")
} else this
@sorny
sorny / x11_forwarding_macos_docker.md
Last active May 15, 2024 08:29
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@catalinsgh
catalinsgh / PasswordValidatorTest.kt
Created June 30, 2020 18:40
PasswordValidatorTest using dynamic tests
internal class PasswordValidatorTest {
private val validator = PasswordValidator()
@TestFactory
fun `given input password, when validating it, then is should return if it is valid`() =
listOf(
"Test123!" to true,
"#tesT12!" to true,
"12Es@t123" to true,
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp