... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| function get_devices() { | |
| all_devices=$(command adb devices) | |
| # Drop the title | |
| all_devices=${all_devices#"List of devices attached"} | |
| # Drop any unauthorised devices (i.e. USB debugging disabled or authorisations revoked) | |
| valid_devices=$(echo $all_devices | grep -v "([[:alnum:]-]+[[:space:]]+unauthorized$)" | grep -oE "([[:alnum:]-]+[[:space:]]+device$)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put it to .github/workflows/stale.yml | |
| name: Close stale issues and pull requests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '30 1 * * *' | |
| jobs: | |
| stale: |
This DAO REPRESENTATION AGREEMENT (this “Agreement”) is made as of [[Effective Date]], by and between [[DAO Name]] (the “DAO”)[, a [[DAO Legal Structure]]] rooted on the [[Blockchain Name]], chainId:[[chainId]] at the public key [[DAO Public Key]] (the “Public Key”), and [[Representative Name]], a [[Representative Legal Structure]] (the “Representative”).
WHEREAS, the DAO desires to engage the Representative to manage its legal operational concerns, and the Representative desires to offer such services on the terms set forth herein;
NOW, THEREFORE, in consideration of the mutual covenants, agreements, representations and warranties contained herein, and intending to be legally bound hereby, the parties hereto hereby agree as follows:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.annotation.SuppressLint | |
| import androidx.compose.animation.core.animateDpAsState | |
| import androidx.compose.animation.core.animateFloatAsState | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.background | |
| import androidx.compose.foundation.gestures.awaitFirstDown | |
| import androidx.compose.foundation.gestures.forEachGesture | |
| import androidx.compose.foundation.gestures.horizontalDrag | |
| import androidx.compose.foundation.layout.Arrangement.spacedBy | |
| import androidx.compose.foundation.layout.Box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Sign in to Xbox Live with OAUTH2 | |
| 1. Go to https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade | |
| 2. Register new app ("+ New registration") | |
| 2.1. Enter a name for your app | |
| 2.2. Set "Supported account types" to "Personal Microsoft accounts only" | |
| 2.3. Click register | |
| 2.4. Choose "Redirect URIs" -> "Add a Redirect URI" | |
| 2.5. Click "Add a platform" -> "Mobile and desktop applications" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Singelton private constructor(context: Context) { | |
| companion object { | |
| @Volatile | |
| private var INSTANCE: Singelton? = null | |
| fun getInstance(context: Context): Singelton = | |
| INSTANCE ?: synchronized(this) { | |
| INSTANCE ?: Singelton(context).also { INSTANCE = it } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # An example to get the remaining rate limit using the Github GraphQL API. | |
| import requests | |
| headers = {"Authorization": "Bearer YOUR API KEY"} | |
| def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
| request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
| if request.status_code == 200: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun <T, B> createJsonRpcService(service: Class<T>, | |
| client: JsonRpcClient<B>, | |
| resultDeserializer: Deserializer<B>, | |
| logger: (String) -> Unit = {}): T { | |
| val classLoader = service.classLoader | |
| val interfaces = arrayOf<Class<*>>(service) | |
| val invocationHandler = createInvocationHandler(service, client, resultDeserializer, logger) | |
| @Suppress("UNCHECKED_CAST") |
NewerOlder