View preload-css.plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { registerPlugin } from '@scullyio/scully'; | |
export const PreloadCssPlugin = 'PreloadCssPlugin'; | |
export const preloadCssHandler = async (html: string): Promise<string> => { | |
html = html.replace( | |
/<link rel="stylesheet" href="([\w\d\.-]+\.css)">/g, | |
`<link rel="preload" as="style" href="$1"> | |
<link rel="stylesheet" type="text/css" media="print" onload="this.media='all';" href="$1"> |
View server.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'zone.js/node'; | |
import 'dotenv/config'; | |
import '@ng-web-apis/universal/mocks'; | |
import { ngExpressEngine } from '@nguniversal/express-engine'; | |
import * as express from 'express'; | |
import { join } from 'path'; | |
import { AppServerModule } from './src/main.server'; | |
import { APP_BASE_HREF } from '@angular/common'; |
View logger.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { isPlatformBrowser } from '@angular/common'; | |
import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; | |
import { environment } from '../../environments/environment'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class LoggerService { | |
constructor(@Inject(PLATFORM_ID) private platform: any) { |
View abstract-cache.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
// Ref https://medium.com/@AurelienLeloup/cache-http-requests-with-rxjs-for-angular-eb9bee93824d | |
type CacheItem<T> = { | |
date : Date, | |
value: Observable<T> | |
}; | |
@Injectable({ |
View custom-puppeteer-render.plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Patched to include timeout support | |
*/ | |
// tslint:disable: no-string-literal | |
// const puppeteer = require('puppeteer'); | |
import { HandledRoute, scullyConfig, log, logError, logWarn, createFolderFor, registerPlugin, getPluginConfig } from '@scullyio/scully'; | |
import { scullySystem } from '@scullyio/scully/src/lib/pluginManagement/pluginRepository'; | |
import { launchedBrowser, reLaunch } from '@scullyio/scully/src/lib/renderPlugins/launchedBrowser'; | |
import { ssl, showBrowser } from '@scullyio/scully/src/lib/utils'; |
View motospeed_ck62.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Motospeed CK62 nearly as Apple keyboard", | |
"rules": [ | |
{ | |
"description": "Modifiers position: Left Ctrl Alt/Option Command - Right Command Alt/Option Fn (CK62 Fn key is unused)", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "application" |
View gist:231bb5c65a1faf7571c846dfc49a3263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RemoteLibraryService } from './../services/remote-library.service'; | |
import { Component, OnInit, AfterViewInit, OnDestroy } from '@angular/core'; | |
declare global { | |
var externalLibrary: any; | |
var otherExternalLibrary: any; | |
} | |
@Component({ | |
selector: 'app-wrapper', |
View remote-library.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Inject } from '@angular/core'; | |
import { ReplaySubject, Observable, forkJoin } from 'rxjs'; | |
import { DOCUMENT } from '@angular/common'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class RemoteLibraryService { | |
// Ref.: https://codeburst.io/lazy-loading-external-javascript-libraries-in-angular-3d86ada54ec7 |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jshint esversion: 6 | |
/** | |
* El comentario jshint es para indicar al parser de javascript del editor que se utilizarán | |
* características de ES6 (EcmaScript 6), como funciones de flecha, const, let, y otros. | |
*/ | |
/** | |
* Requeridos para poder definir la API | |
* - express: permite definir los endpoints de la aplicación | |
* - cors: permite que los endpoints de la API sean accesibles desde servidores externos |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Ionic App</title> | |
<base href="/" /> | |
<meta | |
name="viewport" |
NewerOlder