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
extension PresentationDetent { | |
/// Converts a `PresentationDetent` to an `ExpandableSheetDetent` | |
/// NOTE: Detents created using `.custom(_)` will fail to convert. | |
var expandableSheetDetent: ExpandableSheetDetent { | |
if self == .medium { return .medium } | |
if self == .large { return .large } | |
if let height = heightValue { return .height(height) } | |
if let fraction = fractionValue { return .fraction(fraction) } | |
| |
let unknownType = type(of: self) |
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
#!/bin/bash | |
############################################################################### | |
# Script to create a new git branch for a JIRA ticket, using the ticket URL. # | |
# # | |
# Usage: gb-ticket.sh <ticket_url> <desc> # | |
############################################################################### | |
# Require parameters and parse them | |
if [ $# -ne 2 ]; then |
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 kill_process_using_port() { | |
echo "attempting to kill process on port $1" | |
PID=$(lsof -t -i ":${1}") | |
if [ -z "${PID}" ]; then | |
echo "no process found using port ${1}" | |
return 1 | |
fi | |
echo "killing pid ${PID}" | |
kill -9 "${PID}" | |
return 0 |
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
#!/bin/bash | |
temp=$(</sys/class/thermal/thermal_zone0/temp) | |
freq_hz=$(</sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) | |
temp_f=`echo "$temp/1000" | bc -l` | |
freq_ghz_f=`echo "$freq_hz/1000000" | bc -l` | |
printf "CPU Temp: %.2f°C\n" $temp_f |
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
#!/bin/bash | |
# Discussion, issues and change requests at: | |
# https://github.com/nodesource/distributions | |
# | |
# Script to install the NodeSource Node.js 12.x repo onto an | |
# Enterprise Linux or Fedora Core based system. | |
# | |
# Run as root or insert `sudo -E` before `bash`: | |
# |
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
extension View { | |
func horizontalGuide(_ which: HorizontalAlignment, compute: @escaping (ViewDimensions) -> CGFloat) -> some View { | |
return alignmentGuide(which, computeValue: compute) | |
} | |
func verticalGuide(_ which: VerticalAlignment, compute: @escaping (ViewDimensions) -> CGFloat) -> some View { | |
return alignmentGuide(which, computeValue: compute) | |
} | |
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 io.reactivex.Observable | |
import io.reactivex.Single | |
/** | |
* Something that can be executed. | |
* @param ArgsType The argument data type. | |
* @param ReturnType The return data type for the execution | |
*/ | |
interface AbstractExecutable<ArgsType : Any, ReturnType : Any> { |
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
/** | |
* Data store for application preferences. | |
*/ | |
interface AppPreferences { | |
/** | |
* Get the preference value for the given key. | |
* @param T The value type. | |
*/ | |
operator fun <T : Any> get(key: String): T? |
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
package com.beartooth.relaytestapp.util | |
import java.lang.ref.WeakReference | |
/** | |
* Require.kt | |
* author: jefferson jones | |
* org: Beartooth, Inc | |
* github: github.com/masterjefferson | |
* email: [email protected] |
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.os.Build; | |
/** | |
* Utility methods related to physical devies and emulators. | |
*/ | |
object Phone { | |
val isEmulator: Boolean get() { | |
return Build.FINGERPRINT.startsWith("generic") | |
|| Build.FINGERPRINT.startsWith("unknown") |
NewerOlder