ng new ngrx-example
cd ngrx-example
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 { reducer, initialState } from './counter-control.reducer'; | |
import * as CounterControlActions from './counter-control.actions'; | |
describe('CounterControl Reducer', () => { | |
describe('an unknown action', () => { | |
it('should return the previous state', () => { | |
const action = {} as any; | |
const result = reducer(initialState, action); |
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
type CheckValidFn = (v: any) => ValidationErrors | null; | |
const createValidatorFn = (...checkValids: CheckValidFn[]): ValidatorFn => { | |
const check = and(...checkValids); | |
const validator = (control: AbstractControl) => check(control.value); | |
return validator; | |
}; | |
const and = (...checkValids: CheckValidFn[]): CheckValidFn => { |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"reflect" | |
"github.com/labstack/echo/v4" | |
) |
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
package main | |
import ( | |
"fmt" | |
"github.com/go-playground/validator/v10" | |
) | |
type Foo struct { | |
// ID string `validate:"alphanum,len=3|len=5,excludesall=abcdefghijklmnopgrstuvwxyz"` |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type ID struct { | |
CountryName string `hoge:"hello,foo" json:"cname"` | |
Index int `hoge:"world" json:"hogege"` |
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
aws dynamodb create-table \ | |
--table-name Music \ | |
--attribute-definitions \ | |
AttributeName=Artist,AttributeType=S \ | |
AttributeName=SongTitle,AttributeType=S \ | |
--key-schema \ | |
AttributeName=Artist,KeyType=HASH \ | |
AttributeName=SongTitle,KeyType=RANGE \ | |
--provisioned-throughput \ | |
ReadCapacityUnits=10,WriteCapacityUnits=5 \ |
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
set hlsearch | |
set tabstop=2 | |
set shiftwidth=2 | |
set statusline=%f | |
set laststatus=2 | |
set softtabstop=2 | |
set autowrite | |
call plug#begin('~/.vim/plugged') | |
" go |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"strings" | |
jwt "github.com/dgrijalva/jwt-go" | |
"github.com/gorilla/mux" |
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 torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# dataset | |
# original: f(x) = 2x + 3 | |
dataset_size = 100 |