Skip to content

Instantly share code, notes, and snippets.

View wei-lee's full-sized avatar

Wei Li wei-lee

  • Intercom
  • Dublin, Ireland
View GitHub Profile
@wei-lee
wei-lee / network_security_config.xml
Created July 4, 2018 11:05
network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="user"/>
<certificates src="system"/>
</trust-anchors>
</base-config>
</network-security-config>
@wei-lee
wei-lee / android_build_error.txt
Last active June 19, 2018 09:49
cordova build errors
npm run ionic:android
> [email protected] ionic:android /Users/weili/work/mobile-next/cordova-showcase-template
> ionic cordova run android
? Looks like a fresh checkout! No ./node_modules directory found. Would you like to install project dependencies? Yes
[INFO] Installing dependencies may take several minutes!
> npm install
✔ Running command - done!
@wei-lee
wei-lee / mbaas_collection_update.js
Created April 27, 2018 15:50
fh-mbaas mbaas collection update
use fh-mbaas
print("mbaas: Remove documents that are not belong to the mmetting domain")
db.mbaas.remove({
'domain': {
'$ne': 'mmetting'
}
})
print("mbaas: Updating hosts for codefesttest environment")
func testDateInterval() {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss ZZZ"
let date1 = dateFormatter.date(from: "2018-03-16 14:00:00 +0000")!
let date2 = dateFormatter.date(from: "2018-03-15 14:00:00 +0000")!
let diff = date1.timeIntervalSinceNow
XCTAssertTrue(diff != 0)
}
//
// OIDCAuthenticator.swift
// AGSAuth
import Foundation
import AGSCore
import AppAuth
public class OIDCAuthenticator: Authenticator {
@wei-lee
wei-lee / README.md
Last active November 23, 2017 16:54
openshift cca screenshots

Here are the screenshots to demostrate how to perform client certificate authentication using the OpenShift router

@wei-lee
wei-lee / sample_router_dc.yaml
Created November 23, 2017 16:37
openshift router config to support client certificate authentication
apiVersion: v1
kind: DeploymentConfig
metadata:
creationTimestamp: 2017-11-21T14:35:23Z
generation: 7
labels:
router: router
name: router
namespace: default
resourceVersion: "65033"
@wei-lee
wei-lee / os_sni_verify.map
Created November 23, 2017 15:26
New Mapping File
^www\.rhdev\.me(:[0-9]+)?(/.*)?$ myproject:keycloak
@wei-lee
wei-lee / haproxy-config.template
Created November 23, 2017 14:59
OpenShift HAProxy Router config template
{{/*
haproxy-config.cfg: contains the main config with helper backends that are used to terminate
encryption before finally sending to a host_be which is the backend that is the final
backend for a route and contains all the endpoints for the service
*/}}
{{- define "/var/lib/haproxy/conf/haproxy.config" }}
{{- $workingDir := .WorkingDir }}
{{- $defaultDestinationCA := .DefaultDestinationCA }}
{{- $router_ip_v4_v6_mode := env "ROUTER_IP_V4_V6_MODE" "v4" }}
[base]
tools
platform-tools
[build-tools]
26.0.1
26.0.0
25.0.3
25.0.2