Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Lee Xiang Wei xwlee

🎯
Focusing
View GitHub Profile
View .NET Core.md

Migrate from 2.0 to 3.0

Configure MVC

Change below

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc();
}
@xwlee
xwlee / typescript.md
Last active Jul 29, 2020
Awesome TypeScript Tools
View typescript.md
View helm.md

Install Helm

brew install helm

Initialize official Helm chart repository

helm repo add stable https://kubernetes-charts.storage.googleapis.com/
View Kubelet.md

Kubelet

  • The kubelet is the agent that runs on each node, and is responsible for launching pods.
  • It doesn't directly run containers but instead controls a runtime, such as Docker or rkt.
  • The kubelet operates at the level of PodSpec, so it only knows how to launch pods.
  • The kubelet also runs a tool called cadvisor that collects metrics about resource usage on the node, and using each container that is running on the node, this information can then be used by Kubernetes when making scheduling decisions.
@xwlee
xwlee / using-minikube-cluster.md
Last active Sep 23, 2019
Using Minikube Cluster
View using-minikube-cluster.md

Install minikube

brew install minikube

Create minikube cluster

minikube start
@xwlee
xwlee / web-servers.md
Created Jul 30, 2019 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@xwlee
xwlee / date-directive.js
Created Dec 23, 2018
Apollo Server Date Directive
View date-directive.js
const { ApolloServer, gql, SchemaDirectiveVisitor } = require('apollo-server');
const { GraphQLScalarType, defaultFieldResolver, GraphQLString } = require('graphql');
const { Kind } = require('graphql/language');
const formatDate = require("dateformat");
const typeDefs = gql`
directive @date(
defaultFormat: String = "mmmm d, yyyy"
) on FIELD_DEFINITION
@xwlee
xwlee / rest-directive.js
Created Dec 23, 2018
Apollo Server REST Directive
View rest-directive.js
const {
ApolloServer,
gql,
SchemaDirectiveVisitor
} = require('apollo-server');
const fetch = require('node-fetch');
const typeDefs = gql`
directive @rest(url: String) on FIELD_DEFINITION
@xwlee
xwlee / uppercase-directive.js
Created Dec 23, 2018
Apollo Server Upper Case Directive
View uppercase-directive.js
const {
ApolloServer,
gql,
SchemaDirectiveVisitor
} = require('apollo-server');
const { defaultFieldResolver } = require('graphql');
const typeDefs = gql`
directive @upper on FIELD_DEFINITION
View aws.md

Create new security credentials

  1. Go to Username -> My Security Credentials
  2. A popup will be display, click Continue to Security Credentials for now
  3. Click + Access Key (Access Key ID and Secret Access Key)
  4. Download the Access Key in CSV format, it contains AWSAccessKeyId & AWSSecretKey
  5. You will use this Access Key to configure AWS CLI to interact with AWS Web Services

Configure AWS CLI