Skip to content

Instantly share code, notes, and snippets.

View hongsw's full-sized avatar
🕹️
Focusing

Seungwoo hong hongsw

🕹️
Focusing
View GitHub Profile
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
class ExpansionTileSample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@hongsw
hongsw / handler.js
Created May 2, 2022 06:24
day-2-step-5-stock-emtpy-to-factory-lambda
const axios = require('axios');
const consumer = async (event) => {
for (const record of event.Records) {
console.log("record")
console.log(record)
const response = await axios.post(
'http://factory.p3.api.codestates-devops.be:8080/api/manufactures',
// '{\n "MessageGroupId": "stock-arrival-group",\n "MessageAttributeProductId": "CP-502101",\n "MessageAttributeProductCnt": 10,\n "MessageAttributeFactoryId": "FF-500293",\n "MessageAttributeRequester": "\uD64D\uAE38\uB3D9",\n "CallbackUrl": "http://factory.p3.api.codestates-devops.be:8080/api/manufactures"\n}',
@hongsw
hongsw / github_action_tutorial_init.sh
Last active May 16, 2022 01:26
github action 실습용 준비 스크립트
# 프로젝트 생성
npx create-react-app fe-sprint-cicd-github-action-eg
cd fe-sprint-cicd-github-action-eg
# Github Repo 생성
# gh cli install (참조 : https://github.com/cli/cli)
gh repo create codestates-seb/fe-sprint-cicd-github-action-eg ./
gh repo create <자신githubid>/<만들고싶은repo주소> ./
# Test code 추가 (참조 : https://jestjs.io/docs/tutorial-react)
npm install --save-dev react-test-renderer
npm run test
@hongsw
hongsw / init.sh
Last active May 24, 2022 08:19
Add a new authorized key to an AWS EC2 instance by a new .pem file
chmod 400 new.pem
ssh-keygen -y -f new.pem > new.pub
cat ./new.pub | ssh -i old.pem USER@HOST "cat >> ~/.ssh/authorized_keys"
# Test
ssh -i new.pem USER@HOST
# install minikube 1.26.0
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# upgrade yum and install git
sudo yum upgrade
sudo yum install git
# install golang for cri-dockered
wget https://storage.googleapis.com/golang/getgo/installer_linux
@hongsw
hongsw / flutter_k_webtoon_grid.dart
Last active October 26, 2022 01:11
Flutter K-Web Toon Demo
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart' show debugPaintSizeEnabled;
void main() {
debugPaintSizeEnabled = false; // Set to true for visual layout
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@hongsw
hongsw / flutter_ktoon_tutorial_1.dart
Last active August 26, 2022 04:40
Flutter K-Toon Tutorial 1
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@hongsw
hongsw / fizzBuzz.dart
Last active September 14, 2022 02:56
Fizz Buzz in dart
fizzBuzz(turn) {
var str = '';
if (turn % 3 == 0 && turn % 5 == 0){
str += 'FizzBuzz';
} else if (turn % 3 == 0) {
str += 'Fizz';
} else if (turn % 5 == 0) {
str += 'Buzz';
} if (str.isEmpty){
str = turn.toString();
@hongsw
hongsw / main.dart
Last active September 4, 2022 06:11
primal-gust-2068
void main() {
FizzBuzz f = FizzBuzz();
for (int i = 0; i < 5; i++) {
print(f.myTurn());
}
for (int i = 0; i < 5; i++) {
print(f.myTurn());
}
}
@hongsw
hongsw / main.dart
Created September 7, 2022 02:47
Counter example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override