This file contains 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.fragment.app.FragmentManager | |
import com.google.android.material.datepicker.MaterialDatePicker | |
import com.google.android.material.timepicker.MaterialTimePicker | |
import java.util.Calendar | |
class DateTimePicker( | |
private val datePicker: MaterialDatePicker<Long>, | |
private val timePicker: MaterialTimePicker | |
) { | |
private var onDateTimeSelectedListener: ((dateTime: DateTime) -> Unit)? = null |
This file contains 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
inline fun <reified IT, reified OT> Array<IT>.mapTypedArray(transform: (IT) -> OT): Array<OT> { | |
return map(transform).toTypedArray() | |
} |
This file contains 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 FullScreenDialogFragment : DialogFragment() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setStyle(STYLE_NO_TITLE, R.style.Theme_App_FullScreenDialog) | |
} | |
} |
This file contains 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
(() => { | |
"use strict"; | |
let files = null; | |
window.addEventListener("paste", (event) => { | |
files = event.clipboardData.files; | |
document.querySelector('[aria-label="Search by image"]').click(); |
This file contains 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 android.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.provider.DocumentsContract; | |
import android.provider.MediaStore; |
This file contains 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> MutableList<T>.addOrRemove(item: T) { | |
if (this.contains(item)) { | |
this.remove(item) | |
} else { | |
this.add(item) | |
} | |
} | |
fun <T> MutableList<T>.findIndex(predicate: (T) -> Boolean): Int { | |
val item = this.find(predicate) |
This file contains 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 { fileURLToPath } from "url"; | |
import { dirname, join } from "path"; | |
import { createReadStream, createWriteStream, existsSync, readFileSync, unlinkSync } from "fs"; | |
const __filename = fileURLToPath(import.meta.url); | |
const __dirname = dirname(__filename); | |
const io = Object.freeze({ | |
join, | |
existsSync, |
This file contains 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
#!/usr/bin/env node | |
import debugFactory from "debug"; | |
import dotenv from "dotenv"; | |
import http from "http"; | |
import app from "./../src/app.js"; | |
const debug = debugFactory(process.env.DEBUG); | |
/** |
This file contains 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
#!/usr/bin/env node | |
import debugFactory from "debug"; | |
import http from "http"; | |
import app from "./../app"; | |
const debug = debugFactory(process.env.DEBUG); | |
/** | |
* Get port from environment and store in Express | |
*/ |
This file contains 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
@function make-linear-gradient($degree, $stops) { | |
$gradient: (); | |
@each $percentage, $color in $stops { | |
$gradient: append($gradient, $color $percentage, comma) | |
} | |
@return linear-gradient($degree, $gradient) | |
} | |
.sass { |
NewerOlder