Skip to content

Instantly share code, notes, and snippets.

View TheWebartist's full-sized avatar
❤️
Still coding and enjoy life

Vincent Menant TheWebartist

❤️
Still coding and enjoy life
View GitHub Profile
@TheWebartist
TheWebartist / git-branch-prune.sh
Created May 15, 2025 14:54
Delete other git locales branches than current
git branch | grep -v "$(git symbolic-ref --short HEAD)" | xargs git branch -D
@TheWebartist
TheWebartist / check-serial-number.cmd
Created August 19, 2024 09:56
Get serial number for my MSI device
wmic bios get serialnumber
@TheWebartist
TheWebartist / cmd
Created October 19, 2023 12:43
Docker - Know if a docker container is privileged
# To know if a docker container is privileged
docker inspect --format='{{.HostConfig.Privileged}}' <container_id>
@TheWebartist
TheWebartist / Sample.cs
Created July 25, 2023 10:23
Wait for a ScrollViewer real changed view.
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);
}
@TheWebartist
TheWebartist / storage.js
Created May 10, 2021 16:23
Uses of AsyncStorage for a react-native app
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)
}
}