{{< create-table src="my-table" >}}
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
const std = @import("std"); | |
const Allocator = std.mem.Allocator; | |
pub const LinkedList = struct { | |
head: ?*Node, | |
tail: ?*Node, | |
count: usize, | |
allocator: Allocator, | |
const Node = struct { |
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.os.Bundle | |
import android.view.View | |
import android.widget.Button | |
import android.widget.TextView | |
import androidx.fragment.app.Fragment | |
class SampleFragment : Fragment(R.layout.fragment_sample) { | |
private lateinit var countLabel: TextView | |
private lateinit var decrement: Button |
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/sh | |
check_ffmpeg() { | |
# Check if the `ffmpeg` command is available | |
if which ffmpeg >/dev/null; then | |
# If `ffmpeg` is available, return 0 | |
return 0 | |
else | |
# If `ffmpeg` is not available, return 1 | |
return 1 |
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 id.thony.mockbyreflection | |
import java.lang.reflect.InvocationHandler | |
import java.lang.reflect.Method | |
class MockInvocationHandler : InvocationHandler { | |
override fun invoke(proxy: Any?, method: Method?, args: Array<out Any>?): Any { | |
method ?: throw IllegalStateException("method args is null") | |
val argsList = args?.toList() ?: 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
package id.thony.customview | |
import android.content.Context | |
import android.util.AttributeSet | |
import android.util.Log | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.core.view.children | |
class SimpleFrameLayout @JvmOverloads constructor( |
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 id.thony.examplethread | |
import android.os.Bundle | |
import android.widget.Toast | |
import androidx.appcompat.app.AppCompatActivity | |
import kotlinx.android.synthetic.main.activity_main.* | |
import kotlinx.coroutines.* | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { |
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
def mainClassName = 'sample.app.AppKt' | |
def embeddedJRE = true | |
jar { | |
manifest { | |
attributes( | |
'Main-Class': mainClassName, | |
'Class-Path': configurations.default.collect { it.getName() }.join(' ') | |
) | |
} |
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 java.io.IOException; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import okhttp3.ResponseBody; | |
import retrofit2.Converter; | |
import retrofit2.Retrofit; | |
/** | |
* Created by bradhawk on 1/29/2016. |