Skip to content

Instantly share code, notes, and snippets.

View jplew's full-sized avatar

JP Lew jplew

View GitHub Profile
@jplew
jplew / purifier.php
Created September 28, 2017 21:40
config file for LukeTowers/Purifier
<?php
/**
* Ok, glad you are here
* first we get a config instance, and set the settings
* $config = HTMLPurifier_Config::createDefault();
* $config->set('Core.Encoding', $this->config->get('purifier.encoding'));
* $config->set('Cache.SerializerPath', $this->config->get('purifier.cachePath'));
* if ( ! $this->config->get('purifier.finalize')) {
* $config->autoFinalize = false;
* }
import { TestBed, inject, fakeAsync, tick } from '@angular/core/testing'
import { WordbankService } from './wordbank.service'
import { HttpClient, HttpClientModule } from '@angular/common/http'
import {
HttpTestingController,
HttpClientTestingModule,
} from '@angular/common/http/testing'
import { Observable } from 'rxjs/Observable'
import { of } from 'rxjs/observable/of'
@jplew
jplew / gist:66081e668e78c3e384c5d4dd72abba9f
Created March 7, 2018 19:15
game-message.component.spec.ts
import { async, ComponentFixture, TestBed } from '@angular/core/testing'
import { GameMessageComponent } from './game-message.component'
import { PlayerService } from '@app/services/player.service'
import { ControllerService } from '@app/services/controller.service'
describe('GameMessageComponent', () => {
let component: GameMessageComponent
let fixture: ComponentFixture<GameMessageComponent>
import { Injectable } from '@angular/core'
import { HttpClient } from '@angular/common/http'
import { environment } from '@env/environment'
import { Observable } from 'rxjs/Observable'
import 'rxjs/add/operator/map'
import { WordDoc } from '@interfaces/WordDoc'
import { FragmentMatches } from '@interfaces/FragmentMatches'
import { startWith, tap, retryWhen } from 'rxjs/operators'
import { pipe } from 'rxjs/Rx'
import { of } from 'rxjs/observable/of'
import { TestBed, inject } from '@angular/core/testing'
import { WordService } from './word.service'
import { PlayerService } from '@app/services/player.service'
import { ControllerService } from '@app/services/controller.service'
import { WordbankService } from '@app/services/wordbank.service'
import { HttpClientModule } from '@angular/common/http'
import {
HttpTestingController,
HttpClientTestingModule,
@jplew
jplew / gist:c0ebade552034ea1630ec05067bd18e4
Last active April 19, 2018 12:41
Typescript rewrite of ArcGIS Sample Code
/*
Copyright 2018 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
@jplew
jplew / map.component.ts
Created April 19, 2018 15:16
esri namespace problem
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@jplew
jplew / map.component.ts
Created April 19, 2018 15:45
ArcGIS Inline example working
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Keybase proof

I hereby claim:

  • I am jplew on github.
  • I am jplew (https://keybase.io/jplew) on keybase.
  • I have a public key ASCYtTBpcRGcBz5SrlMo376ZIW0Fzu2hm0ujkEAZ_mBGAgo

To claim this, I am signing this object:

@jplew
jplew / oxfordRoutes.js
Created July 29, 2018 05:28
Oxford API routes in NodeJS/Express
const axios = require('axios')
const oxfordDefine = 'https://od-api.oxforddictionaries.com/api/v1/entries/en'
const oxfordInflect =
'https://od-api.oxforddictionaries.com/api/v1/inflections/en'
const config = {
headers: {
Accept: 'application/json',
app_id: process.env.OXFORD_ID,