Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)
$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
// Consumer usage | |
class MyFragment : Fragment(R.layout.my_fragment) { | |
private val viewModel: MyViewModel by viewModels() | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
val consumer = consumeState(viewModel) | |
} | |
} |
/// | |
/// Swift script to parse, find & replace a set of values with corresponding keys | |
/// from a given file. | |
/// In this case for example it's used to replace strings in `"my.String".localized()` | |
/// with their R.swift generated counterparts. | |
/// | |
/// How to use: | |
/// - copy the script into the project root folder | |
/// - set permissions: `chmod -R +x CleanKeys.swift` | |
/// - run: `./CleanKeys.swift` |
#!/usr/bin/env ruby | |
# This pre-commit hook will prevent any commit to forbidden branches | |
# (by default, "staging" and "production"). | |
# Put this file in your local repo, in the .git/hooks folder | |
# and make sure it is executable. | |
# The name of the file *must* be "pre-commit" for Git to pick it up. | |
def current_branch() | |
branches = `git branch --no-color`.split(/\n/) |
import android.content.Context; | |
import android.os.Debug; | |
import java.io.File; | |
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler { | |
private static final String FILENAME = "out-of-memory.hprof"; | |
public static void install(Context context) { | |
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); |