Skip to content

Instantly share code, notes, and snippets.

@cbarraco
cbarraco / gradle.properties
Created February 25, 2019 03:19
Gradle build optimization for compiling Android apps
// Add this in your global gradle.properties file
// at ~/.gradle/gradle.properties
// Enable Gradle Daemon
org.gradle.daemon=true
// Enable Configure on demand
org.gradle.configureondemand=true
//Enable parallel builds
org.gradle.parallel=true
// Enable Build Cache
android.enableBuildCache=true
@cbarraco
cbarraco / download-docker
Created March 2, 2019 21:02
Direct download link for Docker for Windows without signing in
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
@cbarraco
cbarraco / fast-robocopy-mirror.ps1
Last active May 31, 2024 22:27
Robocopy mirror optimized for speed
# use /MT:1 when the files are big, otherwise if you cancel you'll have 128 big unfinished files instead of a few finished ones
Robocopy.exe /MIR /MT:128 /R:1 /W:1 /LOG:nul /NFL /NDL /NJH /NJS /nc /ns /np <SRC> <DEST>
@cbarraco
cbarraco / BenchmarkDotnetDiscovery.cs
Last active November 7, 2024 18:52
Discovers all classes in the assembly that have [Benchmark] attributes and runs them with BenchmarkRunner (BenchmarkDotNet)
static Type[] GetAllTypesThatHaveBenchmarkMethods()
{
return Assembly.GetExecutingAssembly().GetTypes().Where(
type => type.GetMethods().Any(
method => method.GetCustomAttributes(typeof(BenchmarkAttribute)).Any()
)
).ToArray();
}
var benchmarkTypes = GetAllTypesThatHaveBenchmarkMethods();