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
### Download and setup | |
1. Initially, download the Datomic Pro version on the official website: https://docs.datomic.com/pro/getting-started/get-datomic.html | |
2. Unzip the zip file and move the folder for your desired path, in this case, it will be on `$HOME/datomic` | |
3. Prepare the config file on `$HOME/datomic/config`, there are some examples on `$HOME/datomic/config/samples` | |
4. Add the aliases to your terminal startup file (e.g. `~/.bashrc` or `~/.zshrc`) that will be useful for dealing with your Datomic: | |
``` | |
# To start Datomic REPL: | |
alias datomic-repl="$HOME/datomic/bin/repl" |
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
git filter-branch --force --index-filter \ | |
"git rm --cached --ignore-unmatch *file-path*" \ | |
--prune-empty --tag-name-filter cat -- --all | |
git push --force --verbose --dry-run | |
git push --force | |
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 javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; | |
import javax.crypto.IllegalBlockSizeException; | |
import javax.crypto.NoSuchPaddingException; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.io.IOException; | |
import java.nio.charset.StandardCharsets; | |
import java.security.*; |
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 uploadFile( | |
url: String, | |
headers: Map<String, String>, | |
files: Map<String, Attachment>, | |
formDataParts: Map<String, Any> | |
): Request { | |
val body = | |
MultipartBody.Builder() | |
.setType(MultipartBody.FORM) | |
.apply { |
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
package me.porge.something.adapters | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewGroup | |
import kotlin.reflect.KClass | |
class AnyRvAdapter( | |
private val controllers: Map<KClass<*>, AnyRvItemController<*>>, | |
initialItems: List<Any> = emptyList(), |
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.util.Log | |
import androidx.test.espresso.IdlingRegistry | |
import com.jakewharton.espresso.OkHttp3IdlingResource | |
import okhttp3.Interceptor | |
import okhttp3.OkHttpClient | |
import okhttp3.Response | |
import okhttp3.mockwebserver.MockResponse | |
import okhttp3.mockwebserver.MockWebServer | |
import okhttp3.mockwebserver.QueueDispatcher |
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 androidx.lifecycle.LiveData | |
import androidx.lifecycle.Observer | |
import java.util.concurrent.CountDownLatch | |
import java.util.concurrent.TimeUnit | |
fun <T> LiveData<T>.blockingObserve(): T? { | |
val countDownLatch = CountDownLatch(1) | |
var result: T? = null | |
val observer = Observer<T> { |
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
/* | |
* Copyright 2017 Google Inc. | |
* | |
* 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 |
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/bash | |
clear | |
./gradlew clean mergedJacocoReport | |
./gradlew jacocoFullReport | |
REPORT_PATH="file://$(pwd)/build/reports/jacoco/jacocoFullReport/html/index.html" | |
echo ${REPORT_PATH} | pbcopy | |
echo "Report available at:" | |
echo ${REPORT_PATH} | |
echo "Report file path copied to clipboard. You can paste it in your favorite browser. :)" |
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 smtplib | |
import sys | |
from os.path import basename | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.utils import COMMASPACE, formatdate | |
# Usage: python send_email.py "[email protected]" "pass" "[email protected], [email protected]" "DEV" "ADT" "v1.2.3" "/Users/username/Desktop/log.txt,/Users/username/Desktop/dolog.txt" | |
send_from = sys.argv[1] |
NewerOlder