Skip to content

Instantly share code, notes, and snippets.

import { Injectable, Inject } from "@angular/core";
import { ParsedUrl } from './url/url.interfaces';
import { AppResolverOptions, APP_RESOLVER_OPTIONS } from './app-launcher.interfaces';
@Injectable()
export class AppResolver {
constructor(
@Inject(APP_RESOLVER_OPTIONS) private options: AppResolverOptions
) {}
@okonet
okonet / lightning_talk_proposal.md
Last active April 10, 2018 10:09
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.

@dherges
dherges / component-integration-testing.ts
Last active May 12, 2017 07:23
Angular Testing Snippets
import { CommonModule } from '@angular/common';
import { Component, ElementRef, Renderer, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed, TestComponentRenderer, async, inject } from '@angular/core/testing';
import { FooComponent } from './foo.component';
/** Test component hosting an IconComponent */
@Component({template: `<foo></foo>`})
class TestComponent {
@ViewChild(FooComponent)
@pboos
pboos / annotation-processor-build.gradle
Last active August 7, 2020 06:38
Gradle stuff for Android
configurations {
apt
}
dependencies {
compile 'com.squareup.dagger:dagger:1.1.0'
apt 'com.squareup.dagger:dagger-compiler:1.1.0'
}
android.applicationVariants.all { variant ->
@ficusk
ficusk / GsonRequest.java
Last active April 9, 2024 09:03
A Volley adapter for JSON requests that will be parsed into Java objects by Gson.
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@ianwalter
ianwalter / EvaluateStock.java
Created April 26, 2013 01:38
An example of how to use Mozilla Rhino to execute JavaScript within Java.
package com.iankwalter.rhinostockexample;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
/**
* An example of how to use Mozilla Rhino to execute JavaScript within Java
*
* @author Ian Kennington Walter