Skip to content

Instantly share code, notes, and snippets.

Working from home

Esa Firman esafirm

Working from home
View GitHub Profile
View jacoco-lib.gradle
apply from: "../jacoco.gradle"
def debugTree = fileTree(dir: "${buildDir}/intermediates/packaged-classes/flavorUnsigned", includes: includeFileFilter, excludes: excludeFileFilter)
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/flavorUnsignedDebug", includes: includeFileFilter, excludes: excludeFileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
task jacocoTestReport(type: JacocoReport, dependsOn: ['testFlavorUnsignedDebugUnitTest', 'assembleDebug']) {
reports {
xml.enabled = true
ndbroadbent / ci_cache
Last active Sep 2, 2020
A powerful CI caching tool for Google Cloud Storage
View ci_cache
set -e
# CI Cache Script for Google Cloud Storage
# TIP: Set CI_CACHE_VERBOSE=true while testing the script
# to show a list of all files that are compressed/extracted.
# Note that you might see "tar: write error" if there are too many
# files in the verbose output.
View BugsnagLeakUploader.kt
package com.squareup.leakcanary
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.FAILURE
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.LEAK
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.NOT_FOUND
import com.squareup.leakcanary.BugsnagLeakUploader.ReportType.WONT_FIX_LEAK
bvaughn /
Last active Dec 3, 2020
Interaction tracing with React

Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

This Gist provides some high-level docum

gpeal / build.gradle
Created May 22, 2018
Airbnb Gradle Flavors
View build.gradle
apply from: './flavors.gradle'
android {
buildTypes {
productFlavors {
project.flavors.each { flavor, config ->
"$flavor" {
dimension 'scope'
if (flavor != 'full') {
ggarcia24 / pipeline.gdsl
Last active Oct 9, 2020
GDSL supporting pipeline declarative
View pipeline.gdsl
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable')
property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder')
property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder')
property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar')
# source:
sudo mdutil -Ea
sudo mdutil -ai off
sudo mdutil -ai on
CodingDoug /
Last active Nov 21, 2020
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
chrisbanes / KotterKnife.kt
Last active Nov 8, 2020
LifecycleAware KotterKnife
View KotterKnife.kt
package kotterknife
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent
View unwatch-gh-org.js
// Navigate to and then run:
// Taken from:
.forEach(el => { const org = el.querySelector('a[href^="/YOUR_ORG"]'); if (org) el.querySelector('button').click()});
You can’t perform that action at this time.