Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
| package com.sam016.vsflatomation.service.ble; | |
| import java.util.HashMap; | |
| import java.util.UUID; | |
| public class AllGattCharacteristics { | |
| private static HashMap<String, String> attributes = new HashMap(); | |
| static { | |
| attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name"); |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
| import java.math.BigInteger | |
| import java.security.MessageDigest | |
| fun String.md5(): String { | |
| val md = MessageDigest.getInstance("MD5") | |
| return BigInteger(1, md.digest(toByteArray())).toString(16).padStart(32, '0') | |
| } |
| class View { | |
| void show() { | |
| print("View.show()"); | |
| } | |
| } | |
| class Screen { |
| interface Nameable { | |
| var name: String | |
| } | |
| class JackName : Nameable { | |
| override var name: String = "Jack" | |
| } | |
| class LongDistanceRunner: Runnable { | |
| override fun run() { |
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature" (now available as $ git logs)$ git config --global alias.cis "commit -S" (optional if global signing is false)$ echo "Some content" >> example.txt$ git add example.txt$ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)| // | |
| // The new assembly support in Solidity makes writing helpers easy. | |
| // Many have complained how complex it is to use `ecrecover`, especially in conjunction | |
| // with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call. | |
| // | |
| // Sample input parameters: | |
| // (with v=0) | |
| // "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", | |
| // "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200", | |
| // "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a" |
| private class HttpInterceptor implements Interceptor { | |
| @Override | |
| public Response intercept(Chain chain) throws IOException { | |
| Request request = chain.request(); | |
| //Build new request | |
| Request.Builder builder = request.newBuilder(); | |
| builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |
| /* | |
| * Copyright (C) 2014 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 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |