Skip to content

Instantly share code, notes, and snippets.

View jhcao23's full-sized avatar

John Cao jhcao23

View GitHub Profile
@jhcao23
jhcao23 / shuffle_publish_method.md
Created May 4, 2024 06:33
publish_shuffle_main2gh-pages

publish shuffle.dev generated site

  1. git switch main && git pull
  2. git switch local && git merge main
  3. cp CNAME public/
  4. cp shuffle-for-tailwind.png public/
  5. gh-pages -d public
@jhcao23
jhcao23 / director_classic_books.md
Created January 29, 2024 08:30
director classic books
Title Chinese Title Author Chinese Author Name Publication Year Rating Importance Rating Additional Info One-sentence Summary Category Why Important for Directors
Making Movies 制作电影 Sidney Lumet 西德尼·卢梅特 1995 5.0 Sidne
@jhcao23
jhcao23 / screenplay_classic_books.md
Last active January 29, 2024 05:02
screenplay classic books

编剧classic books

书中文名 书英文名 作者 (中英双语) Year of Publish 一句话总结精辟之处 Additional Key Info Rating
故事 Story 罗伯特·麦基 (Robert McKee) 1997 被认为是讲述故事艺术和编剧技巧的圣经 深入故事结构构建 10
电影剧本写作基础 Screenplay: The Foundations of Screenwriting 西德·菲尔德 (Syd Field) 1979 编剧入门的经典指南 提供基础结构和格式 9.5
救猫咪 Save the Cat! 布雷克·斯奈德 (Blake Snyder) 2005 以其简单直接的风格而闻名 提供商业电影编剧技巧和策略 9
编剧的解剖学 The Anatomy of Story 约翰·特鲁比 (John Truby) 2007 聚焦于故事的深层结构 提供22步剧情结构分析 8.5
写电影 Writing Movies 哥谭编剧学院 (Gotham Writers' Workshop) 2008 实用指南,从构思到完成稿件 涵盖剧本的整个创作过程 8
好脚
@jhcao23
jhcao23 / shadowsocks_in_digitalocean.md
Last active December 11, 2023 07:47
install shadowsocks on digitalocean

Here's the revised summary of the key points covered today:

  1. Updating Ubuntu: Use sudo apt update && sudo apt upgrade -y for package updates and sudo do-release-upgrade for OS upgrades.
  2. Installing Shadowsocks: Install using sudo apt install shadowsocks-libev.
  3. Configuring Shadowsocks: Modify /etc/shadowsocks-libev/config.json for server settings.
  4. Logging: Include "logfile": "/var/log/shadowsocks.log" in the config, ensuring correct permissions.
  5. Managing Shadowsocks Service: Restart with sudo systemctl restart shadowsocks-libev and check its status.
  6. Launching New Instances: For additional users, create new configuration and service files, ensuring unique ports and passwords.
  7. Auto-Restart: Enable automatic restart on boot with sudo systemctl enable shadowsocks-libev.service.
  8. Monitoring Logs: Use sudo journalctl -u shadowsocks-libev for detailed service logs.
@jhcao23
jhcao23 / shadowsocks_in_docker.md
Created December 9, 2023 04:50
deploy shadowsocks server as docker in Amazon Linux 2023

Here's a summary of the useful commands and concepts we discussed today, which you can include in your lecture notes:

  • image: Amazon Linux 2023 in AWS LightSail
  1. Stopping and Starting Docker Containers with Docker Compose:

    • Start containers: docker-compose up -d
    • Stop containers: docker-compose down
  2. Managing the Docker Service:

  • Start Docker service: sudo systemctl start docker
@jhcao23
jhcao23 / west_canada_tour_keypoints.md
Last active September 6, 2023 05:10
key points of West Canada tour

West Canda tour key points

mindmap
  parks((tours))
    Banff))Banff((
      Banff town
      Gondola
      Hot Spring      
 Lake Louise))Lake Louise((
@jhcao23
jhcao23 / StableDiffusion.js
Created July 5, 2023 22:10
LibreChat Stable Diffusion RunPod
// Generates image using stable diffusion webui's api (automatic1111)
const fs = require('fs');
const { Tool } = require('langchain/tools');
const path = require('path');
const axios = require('axios');
const sharp = require('sharp');
// const { run } = require('jest');
class StableDiffusionAPI extends Tool {
constructor(fields) {
@jhcao23
jhcao23 / fitness_app_incentive.md
Last active June 30, 2023 04:12
Fitness App Incentive Ideas
@jhcao23
jhcao23 / lambda_labs_gpu.md
Last active July 29, 2023 20:44
lambda gpu

install things

pre-requisite

  1. create ssh key
  2. save it to laptop
  3. goto your Lambda Labs portal

launch instance

@jhcao23
jhcao23 / eg_mermaid.md
Created June 13, 2023 16:09
mermaid example
flowchart TD

subgraph Client
  Browser -->|HTTP Request| Dispatcher_Servlet
end

subgraph Spring MVC
  Dispatcher_Servlet --> HandlerMapping
 HandlerMapping --> Controller