Skip to content

Instantly share code, notes, and snippets.

View wzr1337's full-sized avatar

Patrick wzr1337

View GitHub Profile
@wzr1337
wzr1337 / expectOptionally.ts
Last active May 5, 2018 21:22
How to expect optionally in jasmine. #Typescript solve: https://github.com/jasmine/jasmine/issues/1539
/**
* Create an optional expectation for a spec.
* @param actual Actual computed value to test expectations against.
*/
export function expectOptionally<T>(actual: any): jasmine.Matchers<T> {
if (!isNullOrUndefined(actual)) {
return expect(actual);
}
const voidExpect = new Proxy(expect(actual),
{
@rduplain
rduplain / MainActivity.java
Created May 8, 2012 20:08
A very simple full-screen WebView activity for Android native wrappers, as a starting point.
package com.willowtreeapps.demo;
import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends Activity {