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
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
@CreatiCoding
CreatiCoding / example.sh
Created November 1, 2021 11:44
echo "N files changed, M insertions(+)"
git diff HEAD --shortstat
@CreatiCoding
CreatiCoding / readme.md
Created October 27, 2021 08:14
when your account dosen't have permission of /usr/local/bin, do this.

Error: The following directories are not writable by your user:

/usr/local/bin

You should change the ownership of these directories to your user.

  sudo chown -R $(whoami) /usr/local/bin
@CreatiCoding
CreatiCoding / rancher.desktop.error.sh
Created October 24, 2021 11:02
rancher desktop 설치시 오류나면
# rancher desktop 설치시 오류나면
sudo ln -s "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/bin/nerdctl" nerdctl