Skip to content

Instantly share code, notes, and snippets.

@oli-g-sk
oli-g-sk / dotnet-delete-bin-obj.ps1
Last active April 7, 2021 19:05
PowerShell script to delete .NET 'bin' and 'obj' folders
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
@oli-g-sk
oli-g-sk / android-util-drawable-gettinted.java
Last active April 7, 2021 19:05
Load and tint a Drawable, with vector support on older API levels
public static class Util {
public Drawable getTintedDrawable(Context context, @DrawableRes int id, @ColorRes int colorId) {
// use AppCompatResources to get Drawable for pre-Lollipop vector compatibility;
Drawable drawable = AppCompatResources.getDrawable(context, id);
if (drawable == null) {
return null;
}