Skip to content

Instantly share code, notes, and snippets.

View TimvdLippe's full-sized avatar

Tim van der Lippe TimvdLippe

View GitHub Profile
@TimvdLippe
TimvdLippe / Whitebox.java
Created February 13, 2019 13:14
Internal copy of Whitebox implementation of Powermock.
package com.facebook.litho;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/** Internal copy of Whitebox implementation of Powermock. */
public class Whitebox {
@SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, String fieldName) {
@TimvdLippe
TimvdLippe / static-analysis-storage-proposal.md
Created February 1, 2018 16:13
Proposal for storage of static analysis warnings in WatchDog

Storage format of Static Analysis Warnings

There are multiple options for storing the static analysis warnings that WatchDog tracks. Since the frequency of warnings is high, we can not send every single event to the server. In that case, the networkload and storage capacity would quickly be overwhelming.

The following requirements are imposed:

  1. The networkload imposed by WatchDog may not increase by more than 20% compared to the current network usage.
  2. All static analysis warning events must be preserved.
  3. All static analysis warnings must be anonymized on the client.
@TimvdLippe
TimvdLippe / polymer-metadata-stats.js
Created July 28, 2017 18:30
Script to obtain stats from Polymer metadata
window.counts = {}
for (const condition of [
'computed trigger.rootProperty equals name',
'computed trigger.rootProperty is name until first dot',
'computed arg.value is empty',
'computed arg.literal is false',
'computed arg.structured is false',
'computed info.methodInfo equals compute effect name',
'computed trigger.wildcard is false',
'computed trigger.literal is false',
@TimvdLippe
TimvdLippe / gradle-sw-precache-wrapper.md
Created September 10, 2016 11:18
Small wrapper example to use sw-precache with Gradle

Writing a custom Gradle wrapper

Using sw-precache with Gradle is rather straightforward which allows you to for example generate a service-worker for the Javadoc of your Java application.

task generateJavadoc(type: Javadoc) {
  <...>
  // Specify your Javadoc options here
  <...>
  // After the javadoc is generated, also generate the service-worker
  doLast {
@TimvdLippe
TimvdLippe / Dependencies tree
Created April 3, 2016 20:24
Project dependencies
/home/tim/Projects/lancie-frontend
├─┬ browser-sync@2.11.2
│ ├── async-each-series@0.1.1
│ ├─┬ browser-sync-client@2.4.1
│ │ ├── etag@1.7.0
│ │ └── fresh@0.3.0
│ ├─┬ browser-sync-ui@0.5.18
│ │ ├── connect-history-api-fallback@1.2.0
│ │ ├─┬ stream-throttle@0.1.3
│ │ │ ├─┬ commander@2.9.0
@TimvdLippe
TimvdLippe / index.html
Created March 30, 2016 19:53
Iron-pages with default route.
<html>
<body>
<carbon-location route="{{route}}"></carbon-location>
<carbon-route pattern="/:page" route="{{route}}" data="{{data}}" tail="{{subData}}"></carbon-route>
<iron-pages attr-for-selected="data-route" selected="{{data.page}}" default-selected="404">
<!--
Example locations:
domain.com/users
domain.com/users/11
-->