This file contains hidden or 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
// Create an order. | |
POST /orders | |
request = { | |
title: 'TITLE', | |
description: 'DESCRIPTION' | |
} | |
response = { | |
id: 'ORDER_ID', | |
title: 'TITLE', |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Generate private key and CSR. | |
openssl req -nodes -newkey rsa:2048 -keyout ssl/server.key -out ssl/server.csr -subj "//CN=devserver" | |
# Auto-signing. | |
#openssl req -x509 -sha256 -days 365 -key ssl/server.key -in ssl/server.csr -out ssl/server.pem | |
openssl x509 -req -days 365 -in ssl/server.csr -signkey ssl/server.key -out ssl/server.crt | |
# Removing CSR. |
This file contains hidden or 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 { ReplaySubject } from 'rxjs/ReplaySubject'; | |
import { Observable } from 'rxjs/Observable'; | |
export abstract class ReplayStore<T> { | |
private _isInitialized = false; | |
private _state: T; | |
private _state$: ReplaySubject<T>; | |
constructor() { |
This file contains hidden or 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
@Injectable() | |
export class ComponentInjector { | |
constructor( | |
private _injector: Injector, | |
private _applicationRef: ApplicationRef, | |
private _componentFactoryResolver: ComponentFactoryResolver) { | |
} |
This file contains hidden or 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
const cleanUp = async () => { | |
const response = await fetch('https://prerender.io/api/cached-pages?page=0&pageSize=100'); | |
const itemList = await response.json(); | |
const csrfToken = document.cookie.replace(/^.*XSRF-TOKEN=/, '').replace(/;.*$/, ''); | |
const promiseList = itemList.map(item => fetch(`https://prerender.io/api/remove-cached-url?url=${encodeURIComponent(item.url)}`, { | |
method: 'DELETE', | |
headers: { |
This file contains hidden or 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
/* | |
* Webpack config | |
*/ | |
/* Use file-loader for images. */ | |
{ | |
test: /\.(gif|ico|jpg|png|svg)$/, | |
loader: 'file' | |
} |
This file contains hidden or 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 'reflect-metadata'; | |
let _contractDictMetadataKey = 'contractDict'; | |
let ApplyContracts = () => { | |
return (target, key) => { | |
let originalMethod = target[key]; | |
let contractDict = Reflect.getOwnMetadata(_contractDictMetadataKey, target, key); |
This file contains hidden or 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
// Generated by CoffeeScript 1.4.0 | |
(function() { | |
var NamedParameters, exports; | |
NamedParameters = (function() { | |
var _assert, _clone; | |
function NamedParameters(m) { | |
this.map = _clone(m); | |
this.coerce_all = false; |
This file contains hidden or 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
| search * | |
| lookup user_agents http_user_agent as user_agent | |
| replace "unknown" with "" in ua_device, ua_os_major, ua_os_minor | |
| replace "Windows*" with "Windows" in ua_os_family | |
| eval user_agent=ua_os_family + " - " + ua_family | |
| regex user_agent!="(unknown|PhantomJS)" | |
| eventstats dc(address) as total | |
| stats dc(address) as count by user_agent, total | |
| eval percentage=(count * 100/total) | |
| table percentage user_agent |
This file contains hidden or 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
defaults write com.google.Chrome AppleLanguages '(en-US)' |