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 branch | grep -v "$(git symbolic-ref --short HEAD)" | xargs git branch -D |
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
wmic bios get serialnumber |
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
# To know if a docker container is privileged | |
docker inspect --format='{{.HostConfig.Privileged}}' <container_id> |
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
public static async Task WaitForCompletedScrollAsync(ScrollViewer scrollViewer, double? horizontalOffset, double? verticalOffset, float? zoomFactor) | |
{ | |
var tcs = new TaskCompletionSource<bool>(); | |
EventHandler<ScrollViewerViewChangedEventArgs> scrollEventHandler = (sender, args) => | |
{ | |
if (!args.IsIntermediate) | |
{ | |
tcs.TrySetResult(true); | |
} |
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 AsyncStorage from '@react-native-async-storage/async-storage' | |
const getDataAsync = async (storageKey, defaultValue = null) => { | |
try { | |
const jsonValue = await AsyncStorage.getItem(storageKey) | |
return jsonValue != null ? JSON.parse(jsonValue) : defaultValue | |
} catch (e) { | |
console.error('Exception when try to get item', storageKey, 'from async storage:', e) | |
} | |
} |