Skip to content

Instantly share code, notes, and snippets.

View CreatiCoding's full-sized avatar
🎯
I may be slow to respond.

정석호 CreatiCoding

🎯
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env bash
# macOS인지 확인
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "이 스크립트는 macOS에서만 실행됩니다."
exit 1
fi
# wget 설치 여부 확인
if ! command -v wget >/dev/null 2>&1; then
ssh-keygen -t rsa -b 4096 -C "$1" -f ~/.ssh/id_rsa-$(echo "$1" | sed 's/@.*//')
#!/usr/bin/env bash
echo "Hello World!"
import rehypeStringify from "rehype-stringify";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import remarkGfm from "remark-gfm";
import unified, { ProcessorSettings, Settings } from "unified";
import type { NextApiRequest, NextApiResponse } from "next";
// case 1 curl -XPOST "http://localhost:3000/api/markdown/render" -d '{ "markdown": "#test\n##test\n\n| ![](https://divopsor.github.io/blog-images/2024/05/18/the-best-welfare-is-colleagues-2-present-1.jpg) | ![](https://divopsor.github.io/blog-images/2024/05/18/the-best-welfare-is-colleagues-2-present-2.jpg) |\n| --- | --- |\n| ![](https://divopsor.github.io/blog-images/2024/05/18/the-best-welfare-is-colleagues-2-present-3.jpg) | ![](https://divopsor.github.io/blog-images/2024/05/18/the-best-welfare-is-colleagues-2.jpg) |\n" }' -H "Content-Type: application/json" | jq
// case 2 curl -XPOST "http://localhost:3000/api/markdown/render" -d '{ "markdown": "test![width=100% test](https://asd.com)" }' -H "Content-Type: applicatio
@CreatiCoding
CreatiCoding / getCalendarEvents.ts
Created August 31, 2024 07:26
Google Calendar List API w/Node.js SDK
import * as calendar from "@googleapis/calendar";
import { format, subDays, addDays, toDate } from "date-fns";
const auth = new calendar.auth.GoogleAuth({
credentials: {
client_email: process.env.GOOGLE_CLIENT_EMAIL,
private_key: process.env.GOOGLE_PRIVATE_KEY
},
scopes: ["https://www.googleapis.com/auth/calendar.readonly"],
});
@CreatiCoding
CreatiCoding / is-js-in.sh
Created March 13, 2023 14:28
is-js-in.sh
if [[ $(node -p "true") == "true" ]]; then
echo "it is true!"
fi
@CreatiCoding
CreatiCoding / skip.sh
Created October 17, 2022 11:41
package'scripts: command 없으면 실행하지 않기
{ command -v || exit 0; } && command something
@CreatiCoding
CreatiCoding / remove-workflow-job.js
Created October 1, 2022 16:03
github action 마지막 workflow 자동으로 지우기
setTimeout(() => [...document.querySelectorAll('.timeline-comment-action.btn-link')].pop().click(), 0);
setTimeout(() => [...document.querySelectorAll('.details-overlay.details-overlay-dark.details-reset > summary')].pop().click(), 500);
setTimeout(() => document.querySelector('.btn-danger.btn.btn-block').click(), 1000);
@CreatiCoding
CreatiCoding / github-action.ssh.yaml
Created September 30, 2022 08:33
github-action for ssh commands
name: remote ssh command
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Deploy
run: |
https://github.com/milooy/remote-or-flexible-work-company-in-korea