Skip to content

Instantly share code, notes, and snippets.

View bndynet's full-sized avatar

Bendy Zhang bndynet

View GitHub Profile
@bndynet
bndynet / ngmodel.md
Last active February 8, 2023 10:28
ngModel in custom component

How to use ngModel in Angular Component?

import { Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';

const noop = () => {
};

export const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR: any = {
@bndynet
bndynet / spring-boot-common-application-properties.txt
Last active April 4, 2018 07:07
Spring Boot - Common application properties
Common application properties for Spring Boot
# ===================================================================
# COMMON SPRING BOOT PROPERTIES
#
# This sample file is provided as a guideline. Do NOT copy it in its
# entirety to your own application. ^^^
# ===================================================================
@bndynet
bndynet / docker.md
Last active June 5, 2018 09:17
Docker

Docker Usage

Commands

  • docker info
  • docker pull [image]
  • docker run [image] /bin/echo Hello Docker
  • docker help
  • docker stop [name]
  • docker restart [name]
@bndynet
bndynet / Manually start angularjs.md
Last active April 4, 2018 07:15
Manually start angularjs

How to start angularjs App manually?

(function() {
	// Get Angular's $http module.
	var initInjector = angular.injector(['ng']);
	var $http = initInjector.get('$http');

	// Get user info.
	$http.get('/user-info').then(
@bndynet
bndynet / build-commands.md
Last active September 20, 2017 06:16
Build Commands

Maven

  • mvn package or mvn compile war:war

MSBuild

-- MSBuild.exe buildapp.csproj /p:Configuration=Release;WarningLevel=2;OutDir=bin\Debug

-- MSBuild.exe solution.sln /t:Rebuild /p:Configuration=Release;PublishProfile=Jenkins-DEV;DeployOnBuild=true;OutDir=bin\Debug

@bndynet
bndynet / yarn-and-npm.md
Last active September 23, 2017 13:40
Yarn and NPM

Commands

YARN NPM DES
yarn init npm init Starting a new project
yarn add [package] yarn add [package]@[version] yarn add [package]@[tag] npm install [package] Adding a dependency
--dev --peer --optional --save-dev --save-prod --save-optional Add to devDependencies, peerDependencies, and optionalDependencies respectively
yarn upgrade [package] yarn upgrade [package]@[version] yarn upgrade [package]@[tag] npm outdated and npm update Upgrading a dependency
yarn remove [package] npm uninstall [package] Removing a dependency
yarn yarn install npm install npm i Installing all the dependencies of project
@bndynet
bndynet / default.md
Last active May 8, 2019 01:31
Linux Shells

Useful Syntax in Shell

#!/bin/bash

#. ./header.sh
#source ./header.sh

echo `date` # print date
printf "Hello, Shell\n"
@bndynet
bndynet / angular-http.md
Last active October 9, 2017 06:05
Angular Http

Call multipal http requests

Need to run a series of HTTP calls, and wait for them all to complete? Use $q.all.

This won’t work:

for(var i = 0; i < 5; i++) {
	$http.get('/data' + i);
}
@bndynet
bndynet / ci-cd-in-docker.md
Last active April 4, 2018 07:13
CI & CD in Docker
@bndynet
bndynet / OPTION method in CORS.md
Created October 12, 2017 08:18
OPTION method in CORS