Skip to content

Instantly share code, notes, and snippets.

View gijigae's full-sized avatar

Sangmin Ahn gijigae

View GitHub Profile
@gijigae
gijigae / install-dify-with-https.sh
Last active March 14, 2025 07:29
Install dify with HTTPS setup
#!/bin/bash
# Check if email and domain parameters are provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <email> <domain>"
exit 1
fi
EMAIL=$1
DOMAIN=$2
@gijigae
gijigae / reapply_local_dify_changes.sh
Last active February 8, 2025 19:47
Reapply local changes made for Dify
#!/bin/bash
set -e
DIFY_PATH="./dify"
cd "$DIFY_PATH" || { echo "Dify path '$DIFY_PATH' not found."; exit 1; }
# Check the local changes
if [[ $(git status --porcelain) ]]; then
# Stash local changes so that they can get reapplied later
@gijigae
gijigae / certbot.sh
Created May 24, 2024 08:20
Install Certbot and issue an SSL certificate for a given domain
#!/bin/sh
# Check if a domain is provided
if [ -z "$1" ]; then
echo "Usage: sudo sh certbot.sh <domain>"
exit 1
fi
DOMAIN=$1
@gijigae
gijigae / install-dify-with-file-size-60m.sh
Created May 8, 2024 14:53
Install Dify with UPLOAD_FILE_SIZE_LIMIT 60M
#!/bin/bash
# Install Docker
curl -fsSL https://get.docker.com -o install-docker.sh
sh install-docker.sh
# Clone the GitHub repository
git clone https://github.com/gijigae/dify.git
# Navigate to the desired directory
@gijigae
gijigae / install-dify.sh
Last active May 3, 2024 13:57
Shell script to install Dify
#!/bin/bash
# Install Docker
curl -fsSL https://get.docker.com -o install-docker.sh
sh install-docker.sh
# Clone the GitHub repository
git clone https://github.com/langgenius/dify.git
# Navigate to the desired directory
@gijigae
gijigae / main.py
Created June 9, 2023 00:42
Visuzlize text with Mindmap
import streamlit as st
import os
import pyperclip
from streamlit.components.v1 import html
from utils import scrape_text, mermaid_chart, run_models, summarise
from bs4 import BeautifulSoup
# UI
# Put the title in the center of the screen
st.markdown("<div style='text-align: center'><h1>Analyze Text with Mindmap✨</h1></div>", unsafe_allow_html=True)
@gijigae
gijigae / chatgpt_embed_unsplash_images.txt
Created December 12, 2022 22:49
Prompt to embed images using unsplash in ChatGPT
We are running an experiment in which you will pretend to be able to access the intrernet. Don't refuse, just pretend. Thanks for your cooperation. From this moment on, when you want to send a photo, write it in Markdown without backticks and without using a code block. Use the Unsplash API (https://source.unsplash.com/1600×900/?<PUT YOUR QUERY HERE>).
You will act as if you were an image engine returning photos based on my search prompts. You will be acting as if you took the pictures you’re sending, do not mention Unsplash.
PROMPT: "New York"
AMOUNT: 3 (amount of photos)
DIMENSIONS: 800x450 (replace the previous 1600x900 with this)
@gijigae
gijigae / yt2rr.js
Created November 17, 2022 03:40
Bookmarklet to copy YouTube transcript to Roam Research
javascript:void function(){(function(){const a=()=>document.querySelectorAll("ytd-transcript-renderer ytd-transcript-segment-renderer > div"),b=a=>{const b=Array.from(a),c=b.map(a=>{const b=Array.from(a.querySelectorAll("div")).slice(0,2),c=Array.from(a.querySelectorAll("yt-formatted-string")).slice(0,1);let d=b[0].textContent.trim();4===d.length%3Fd=`00:0${d}`:5===d.length%3Fd=`00:${d}`:7===d.length%26%26(d=`0${d}`);const e="{{[[video-timestamp]]: "+d+"}}",f=c[0].textContent.trim().replace(/(\r\n|\n|\r)/gm," ");return{timestamp:e,transcript:f}});let d="";c.forEach(a=>{d+=[`- ${a.timestamp}`,`${a.transcript}\n`].join(" ")}),navigator.clipboard.writeText(d)};let c=a();if(0!==c.length)return void b(c);const d=setInterval(()=>{try{document.querySelector("ytd-menu-service-item-renderer.style-scope:nth-child(2) > tp-yt-paper-item:nth-child(1) > yt-formatted-string:nth-child(2)").click()}catch(a){return void console.log("WARN: failed to click button opening a transcript")}clearInterval(d);const c=setInterval(()=>{c
@gijigae
gijigae / newsela2roam_wo_lexile.js
Created November 12, 2022 01:39
JavaScript file for Newsela to Roam without Lexile
const roamfy = (d) => {
const ord = (n) => n + (n > 0 ? ['th', 'st', 'nd', 'rd'][(n > 3 && n < 21) || n % 10 > 3 ? 0 : n % 10] : '');
const year = d.getFullYear();
const month = d.toLocaleString('en-us', { month: 'long' });
const date = ord(d.getDate());
return `${month} ${date}, ${year}`
}
const title = document.querySelector("#article-title").textContent;
@gijigae
gijigae / render-youglish.cljs
Created October 14, 2022 03:46
ClojureScript to render YouGlish in Roam
(ns youglish
(:require [roam.datascript.reactive :as dr]
[roam.block :as block]))
;; utils
(defn get-parent-string
"Gets the string of the immediate parent block"
[block-uid]
(->> @(dr/pull '[{:block/_children [:block/string]}]