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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00 |
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
func convStringsToInts(strings []string) []int { | |
result := make([]int, len(strings)) | |
for i, v := range strings { | |
num, _ := strconv.Atoi(v) | |
result[i] = num | |
} | |
return result | |
} |
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 main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
) | |
var scanner = bufio.NewScanner(os.Stdin) |
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 [YOUR PACKAGE] | |
/* | |
* Copyright 2018 Google LLC | |
* | |
* 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 | |
* | |
* https://www.apache.org/licenses/LICENSE-2.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
@MainThread | |
inline fun <reified VM : ViewModel> Fragment.parentViewModels( | |
noinline ownerProducer: () -> ViewModelStoreOwner = { requireParentFragment() }, | |
noinline factoryProducer: (() -> ViewModelProvider.Factory)? = null | |
) = createViewModelLazy(VM::class, { ownerProducer().viewModelStore }, factoryProducer) |
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
macro_rules! hashmap { | |
($( $key: expr => $val: expr ),*) => {{ | |
let mut map = ::std::collections::HashMap::new(); | |
$( map.insert($key, $val); )* | |
map | |
}} | |
} |
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
fn main() { | |
} | |
fn read<T: std::str::FromStr>() -> T { | |
let mut s = String::new(); | |
std::io::stdin().read_line(&mut s).ok(); | |
s.trim().parse().ok().unwrap() | |
} | |
fn read_vec<T: std::str::FromStr>() -> Vec<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
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.View | |
import androidx.coordinatorlayout.widget.CoordinatorLayout | |
import com.google.android.material.appbar.AppBarLayout | |
class ViewPagerScrollingViewBehavior(context: Context?, attrs: AttributeSet?) : | |
AppBarLayout.ScrollingViewBehavior(context, attrs) { | |
override fun layoutDependsOn( |
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.content.Context | |
import android.util.AttributeSet | |
import android.view.View | |
import androidx.coordinatorlayout.widget.CoordinatorLayout | |
import androidx.core.view.NestedScrollingChild | |
import androidx.core.view.NestedScrollingChildHelper | |
class NestedCoordinatorLayout : CoordinatorLayout, NestedScrollingChild { | |
private var mChildHelper: NestedScrollingChildHelper |
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 BottomWidgetBehavior<V : View>(context: Context, attrs: AttributeSet) : | |
CoordinatorLayout.Behavior<V>(context, attrs) { | |
override fun onStartNestedScroll( | |
coordinatorLayout: CoordinatorLayout, | |
child: V, | |
directTargetChild: View, | |
target: View, | |
axes: Int, | |
type: Int |
OlderNewer