Skip to content

Instantly share code, notes, and snippets.

@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
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)
@Pulimet
Pulimet / AdbCommands
Last active May 5, 2024 21:47
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader

Sony Bravia HTTP API

The sony bravia has a HTTP API interacted with using a Pre-Shared key. There's a more complex auth flow but I've not described it here.

There wasn't any documentation, so I've written some. If you're a TV integrator don't read this, you'll laugh. I'm probably just getting confused by UPnP.

Disclaimer: I've only tested this on my TV, which is a KDL-50W829B. Your TV might not have all of the services; see Available services section for how to discover what your TV supports.

@nepsilon
nepsilon / how-to-use-mac-keychain-to-store-github-repos-credentials.md
Created July 18, 2017 06:50
How to use Mac KeyChain to store GitHub repos credentials? — First published in fullweb.io issue #108

How to use Mac KeyChain to store GitHub repos credentials?

You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.

Chances are you already have the git credential-osxkeychain command installed. If not, just install Git with brew: brew install git.

Once installed, just tell Git to use the KeyChain to store your credentials:

git config --global credential.helper osxkeychain
@titoaesj
titoaesj / .kt
Last active March 17, 2024 22:22
Android convert int to dp
OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics())
##KOTLIN
val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
val Float.dp: Int

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@harmittaa
harmittaa / .travis.yml
Last active November 22, 2020 05:38
Example .travis.yml file for Android
# Tutorial here: https://medium.com/@harmittaa/travis-ci-android-example-357f6e632fc4
language: android
sudo: required
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@venator85
venator85 / LibraryProjectTestRunner.java
Created September 6, 2016 10:43
A Robolectric test runner for library projects compatible with Android Gradle plugin 2.2.0-alpha6 and later
import org.junit.runners.model.InitializationError;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.internal.bytecode.InstrumentationConfiguration;
import org.robolectric.manifest.AndroidManifest;
import org.robolectric.res.FileFsFile;
import org.robolectric.res.FsFile;
public class LibraryProjectTestRunner extends RobolectricTestRunner {
@subharanjanm
subharanjanm / clamav-mac.md
Created August 30, 2016 14:16 — forked from dkobia/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so