WinForm 还原窗口时居中显示

//在窗口的resize事件中写代码
private void Form_Order_Content_Resize(object sender, EventArgs e)
{
    //还原窗口时居中显示
    int screenTop = (System.Windows.Forms.Screen.GetWorkingArea(this).Width-this.Width)/2;
    int screenLeft = (System.Windows.Forms.Screen.GetWorkingArea(this).Height-this.Height)/2;
    if (this.WindowState == FormWindowState.Normal)
    {
        this.Location = new Point(screenTop, screenLeft);
    }
}

Filter Duplicate Adjacent Array Items

Filter out duplicate items in an array that are directly adjacent to one another. ex: [1, 1, 4, 4, 4, 7, 7, 2, 2, 2, 5, 5] becomes [1, 4, 7, 2, 5]
function uniqueArray(arr) {
    return arr.filter((val, i, arr) => {
        if (i === 0) return true;
        return !(val === arr[i - 1]);
    }
}

Error: Heuristic Error on Using GraphQL Interface

## When Heuristic Error on Using GraphQL Interface

interface 사용 시 heuristic matcher 써야 하는데

[commit](https://github.com/godon019/Temple-Resource-Management/commit/3c26d3e7140063df09e444117ce2868668a8689b)

- [https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher](https://www.apollographql.com/docs/react/advanced/fragments.html#fragment-matcher)

이때에 playground에 아래와 같은 요청을 작성하면

    {
      __schema {
        types {
          kind
          name
          possibleTypes {
            name
          }
        }
      }
    }

나오는 결과에서

    "possibleTypes": null

을 가지지 않는 것만 따로 빼서 아래와 같이 만들어서 파일을 작성하여 활용한다

fragmentTypes.json

    {
      "__schema": {
        "types": [
          {
            "kind": "INTERFACE",
            "name": "Reportable",
            "possibleTypes": [
              {
                "name": "Bulsageum"
              },
              {
                "name": "Expense"
              },
     

JSON loop into html

  function showQuickView(link,e){
            // $jQ('.product-quick-view').empty();
            var quickUrl=link.data('url');
            console.log(quickUrl);
            $jQ.ajax({
                type: 'GET',
                url: quickUrl,
                dataType: 'json',
                success: function (data) {
                    $jQ('.product-quick-view .product-title').html(data.name_t);
                    $jQ('.product-quick-view .price').html('$'+data.price);
                    $jQ('.product-quick-view .afterpay-price .price-bundle').html('<span>'+data.afterpayInstallments+'</span>');
                    $jQ('.product-quick-view .pop-up-img-wrapper').html("<img src='"+data.productImage+"'>");
                    var numberOfItems = 0;
                    var elementReview = 0;
                    var elementReviews = 0;
                    $jQ.each(data.reviews, function(index, element) {
                        elementReview += element.rating_percent;
                

config de stie estatic nginx

server {
	listen 8000;

	server_name clipping.cc;

	root /var/www/clipping-front/build;
	index index.html index.htm;
	
	
	

    # Any route that doesn't have a file extension (e.g. /devices)
    location / {
        try_files $uri /index.html;
    }
}

React styled-component

import React, { Component, Fragment } from "react";
import styled, { createGlobalStyle, css, keyframes } from "styled-components";

const GlobalStyle = createGlobalStyle`
  body {
    padding: 0;
    margin: 0;
  }
`;

export default class App extends Component {
  render() {
    return (
      <Fragment>
        <GlobalStyle />
        <Container>
          <Button>Hello</Button>
          <Button danger rotationTime={1}>
            Hello
          </Button>
          <Anchor href="http://google.com">Go to google</Anchor>
        </Container>
      </Fragment>
    );
  }
}

const Container = styled.div`
  height: 100vh;
  width: 100%;
  background-color: pink;
`;

const Button = styled.button`
  border-radius: 50px;
  padding: 5px;
  min-width: 120px;
  color: white;
  font-weight: 600;
  -webkit-appearance: none;
  cursor: pointer;
  &:active,
  &:focus {
    outline: none;
  }
  background-color: ${props => (props.danger ? "#e74c3c" : "#2ecc71")};
  ${props => {
    if (props.dange

Object.assign()

Allows to easily copy values from one object to another. Object.assign becomes really useful to create completely new objects from existing ones, allowing you to copy and expand objects in an immutable manner.
let obj = {
  first: 'chase',
  last: 'isley',
  age: 31,
  location: {
    city: 'Las Vegas',
    state: 'NV'
  }
}

// create new Obj, copying values from obj and adding a new prop and value. Original obj does not get the new property and value
let obj2 = Object.assign({}, obj, { zip: 89011 });
console.log(obj2)

// Modify obj values
Object.assign(obj, { first: 'Chasito' });
console.log(obj)

for-of vs for-in loop

Use for…of to iterate over the values in an iterable, such as an array, string, maps, sets, generators, DOM node collections and arguments object Use for…in to iterate over the properties of an object (the object keys)
// for-in
let obj = {
  name: 'chase',
  age: 31,
  location: {
    city: 'Las Vegas',
    state: 'NV'
  }
}

for (let value in obj) {
  console.log(value) // name, age, location
}

// for-of
for (let value of Object.values(obj)) {
  console.log(value)
}

Object.values()

The Object.values() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
let obj = {
  name: 'chase',
  age: 31
}
let values = Object.values(obj);
console.log(values) // ["chase", 31]

for (let value of Object.values(obj)) {
  console.log(value)
}

EditorConfig file for .NET projects based on C# or VB + Markdown documentation

EditorConfig file for .NET projects based on C# or VB + Markdown documentation (see more details here https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019#expression_level_csharp)
###############################
# Core EditorConfig Options   #
###############################

root = true

# All files
[*]
charset = utf-8

# Markdown files
[*.md]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

# Code files (.NET)
[*.{cs,csx,vb,vbx}]

# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4

# New line preferences
end_of_line = crlf
insert_final_newline = false

###############################
# .NET Coding Conventions     #
###############################

[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# this. and Me. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent

# Language keywords vs BCL types preferences
dotnet

DB Naming Convention

# Base de datos
#### Manejadores de base de datos
- MySQL
- SQL Server
- Oracle
- AS 400
- ProstgreSQL

#### Naming Convention
- Tablas
  - Nombres sencillos
  - Descriptiva
  - En singular
  - No usar prefijos
  - No usar caracteres especiales
  - Notacion en Pascal Case
  - No abreviaciones
- Columnas
  - Llave primaria
    - [Nombre Tabla] + ID
    - ID + [Nombre Tabla]
    - ID
  - Llave Foranea
    - Mismo nombre que la table de donde proviene
  - No usar prefijos
  - Nombres especificos
    - ISACTIVE
    - HASPERMISSION
  - Notacion en Pascal Case
  - Pascal Case
- Indices
  - IX_[Table]_[Objetivo]
- Contraints
  - [Tipo]_[Table]_[Columna]
    - Tipo
      - PK Llave Primaria
      - FK Llave Foranea
- Vistas / SP / Triggers / Funciones
  - Prefijo (2 Letras)
    - Opcional
  - Descriptivo

**TIPS - A los campos no se recomienda introducir numeros en los nombres.**

**TIPS - Declarar los valores Bool en True siempre**

Normalizacion BD

## Normalizar BD

### 1N 
No tener campos repetidos, tener solo atributos atomicos
- Los registros no se pueden repetir

Llave primary no puede ser null

### 2N
### Dependencia funcional
Todos lo campos de una tabla tienen que tener una dependencia funcional con la primary key.

Pais|
---|---
Pais |
PaisID|
Nombre|
---
Estado|
---|---
EstadoID|
Nombre|
PaisID|
---
Ciudad|
---|---
CiudadID|
Nombre|
EstadoID|
---
Persona|
---|---
Nombre|
Apellido|
CiudadID|
---

### 3N
Ningun campo no clave depende de otro campo no clave
No hay referencia entre no claves y claves

#### 3N Boyce
No tener campos innecesarios en la tabla si es posible separarlos

#### 4N M:M
Eliminar la redundancia , Se puede hacer una llave compuesta con las llaves relacionadas o hacer una llave primaria para la tabla relacion

Es mejor hacer llave compuesta ya que la llave primaria debe de ser unica

#### 5N Proyecciones y uniones

#### 6N Desnormalizar

## Reglas de la normalizacion
1. Atributo Atomico
2. Dependencias Fu

docker get started

Saved from https://docs.docker.com/get-started/
## List Docker CLI commands
docker
docker container --help

## Display Docker version and info
docker --version
docker version
docker info

## Execute Docker image
docker run hello-world

## List Docker images
docker image ls

## List Docker containers (running, all, all in quiet mode)
docker container ls
docker container ls --all
docker container ls -aq

Made with ♥ by Union

console.log('made with ♥ by...\n __  __ \n|  ||  |  __  _    __    _  _    __  _ \n|  ||  | |  ||  \\ |  |  / || \\  |  ||  \\ \n|  ||  | |  ||  | |  | (  ||  ) |  ||  |\n \\_||__| |__||__| |__|  \\_||_/  |__||__|\n                         http://union.co',);

fullScreen

fullScreen() {
    let elem = document.documentElement;
    let methodToBeInvoked = elem.requestFullscreen ||
      elem.webkitRequestFullScreen || elem['mozRequestFullscreen']
      ||
      elem['msRequestFullscreen'];
    if (methodToBeInvoked) methodToBeInvoked.call(elem);
}

Nav Bar things

        //color navbar
        UINavigationBar.appearance().tintColor = .navBarColor
        UINavigationBar.appearance().isTranslucent = false
        //Get rid of grey separator bottom of navbar
        UINavigationBar.appearance().shadowImage = UIImage()
        UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)