본문 바로가기 메뉴 바로가기

민호.닷컴

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

민호.닷컴

검색하기 폼
  • 분류 전체보기 (105)
    • 소소한일상 (7)
    • 관심폭발 (5)
    • 공부합시다 (47)
      • ionic (2)
      • php (16)
      • express (2)
      • python (5)
      • Golang (4)
    • 비밀이여 (0)
    • 갑자기 문뜩 (5)
    • What did u do today (0)
  • 방명록

공부합시다 (76)
Redis pub/sub in golang

go get github.com/go-redis/redis/v8 package main import ( "context" "fmt" "github.com/go-redis/redis/v8" ) func main() { // Redis 연결 rdb := redis.NewClient(&redis.Options{ Addr: "{host}", Password: "{password}", DB: "{dababase}", }) ctx := context.Background() pubsub := rdb.Subscribe(ctx, "mychannel") defer pubsub.Close() // 고루틴으로 수신된 메시지를 처리 go func() { for { msg, err := pubsub.ReceiveMessage(c..

공부합시다/Golang 2023. 5. 4. 08:59
GVM으로 go설치하기

nodejs의 NVM과 같이 golang에도 GVM을 통해 버전관리가 가능하다. gvm: https://github.com/moovweb/gvm GVM 설치하기 // zsh $ zsh <

공부합시다/Golang 2023. 3. 30. 13:27
golang 웹크롤링 예제

package main import ( "fmt" "io/ioutil" "net/http" ) func main() { // 크롤링할 URL 리스트 urls := []string{ "https://www.example.com", "https://www.example.com/page1", "https://www.example.com/page2", } // 응답 본문을 받을 채널 respChan := make(chan string) // URL 리스트를 순회하며 각 URL을 처리하는 고루틴을 생성합니다. for _, url := range urls { go func(url string) { respBody, err := httpGet(url) if err != nil { fmt.Printf("Error ge..

공부합시다/Golang 2023. 3. 15. 09:19
git merged branch 삭제하기

remote에서 머지된 브랜치 일괄 삭제하기 // master, feature 브랜치 제외 머지된 브랜치 삭제하기 git branch --merged | grep -v '\*' | grep -v master | grep -v feature | xargs -n 1 -r git branch -d 참고: https://digitaldrummerj.me/git-remove-local-merged-branches/ Git - Remove Local Branches That Are Merged or No Longer Exist After a while your list of local git branches can get a bit out of control especially if you doing all of ..

공부합시다 2022. 4. 18. 09:27
Golang으로 Todo 만들기

새로운 프로젝트 시작하면서 새로운 언어와 프레임워크를 도입하게 되었다. 간단하게 Golang을 배우면서 Todo 앱을 만들어보기로 한다. Golang ORM은 대부분 gorm을 많이 사용하나, 공식적으로 지원하는 DB가 적다. 최근까지 활발하게 업데이트도 되고 github 별점도 높으나 공식적으로 지원하는 DB가 한정적이라 일단 그다음으로 많은 xorm으로 적용해 보았다. 특별히 gorm과 많이 다르지 않아서 별 차이없는 없는 듯. 다만 22년 1월 현재기준. 20년 업데이트가 마지막이라 그 부분에서는 염려가 된다. go get github.com/go-sql-driver/mysql go get github.com/gin-gonic/gin go get xorm.io/xorm go-gin & xorm To..

공부합시다/Golang 2022. 1. 21. 14:49
JS Array 중복 제거하는 방법 ES6

Array 중복제거하는 방법 보통 filter를 주로 사용하였으나 다른 방법이 있는지 찾아보았다. # Filter const array = [&#39;a&#39; , 1, 2, &#39;a&#39; , &#39;a&#39;, 3]; array.filter((item, index) => array.indexOf(item) === index); # Set const array = [&#39;a&#39; , 1, 2, &#39;a&#39; , &#39;a&#39;, 3]; [...new Set(array)]; //or Array.from(new Set(array)); # Reduce const array = [&#39;a&#39; , 1, 2, &#39;a&#39; , &#39;a&#39;, 3]; array..

공부합시다 2021. 8. 5. 11:30
Codeigniter3 + graphql-php

# Composer 설치 # composer 설치해준다. php5.6 이상에서 사용할 수 있음. composer require webonyx/graphql-php # Core/Controller.php class Graphql_Controller extends CI_Controller { public function __construct() { parent::__construct(); } public function response($schema=null) { try{ $input = json_decode(file_get_contents('php://input'), true); $query = $input['query']; $variableValues = isset($input['variables']) ..

공부합시다/php 2021. 6. 2. 15:29
마크다운 사용법

마크다운? Markdown은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다. 1.Headers 제목 This i..

공부합시다 2021. 5. 26. 09:32
이전 1 2 3 4 5 6 ··· 10 다음
이전 다음
공지사항
  • 오예 도메인 주소 변경
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • 코드스쿨
  • 코드전쟁!@
  • 변수명짓기
  • PHP-GRAPHQL
  • 해커랭크
  • excaildraw
TAG
  • MySQL
  • laravel-test
  • addMonth
  • graphql
  • 자바스크립트
  • Laravel
  • laravel-kafka
  • 메일
  • msmtp
  • php
  • 테스트_다중트랜잭션
  • graphql-php
  • exception-test
  • aaa패턴
  • POP3
  • 정규식
  • 정의
  • l5-swagger-response
  • observer 매개변수 전달하기
  • 라라벨
  • django
  • Python
  • bitwarden-cli
  • vim
  • 컨테이너내에서 메일 발송하기
  • password-manager
  • addMonthWithoutOverflow
  • l5-swagger
  • redis
  • eloquent-observer
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바