Skip to content

Instantly share code, notes, and snippets.

View Zeyu-Li's full-sized avatar
🐧
Pengwing

Andrew Li Zeyu-Li

🐧
Pengwing
View GitHub Profile
@umanghome
umanghome / publish.yml
Last active June 20, 2025 13:27
GitHub Action: Generate a build and push to another branch
# .github/workflows/publish.yml
name: Generate a build and push to another branch
on:
push:
branches:
- master # Remove this line if your primary branch is "main"
- main # Remove this line if your primary branch is "master"
jobs:
@coleturner
coleturner / framer-motion-use-viewport-scroll-with-element-container.md
Last active November 6, 2024 09:03
(Framer Motion): useViewportScroll with element container

Demo

Context

useViewportScroll is a great way to create a parallax effect as the page scrolls. In some cases however, we only want to scroll when an element is in the viewport area.

So for example, if we have a "landscape" scene, and want to animate the Sun object only when it's in view, we start with our useViewportScroll implementation:

function Sun(props) {
 const { scrollY, scrollYProgress } = useViewportScroll();
@Zeyu-Li
Zeyu-Li / README_old.md
Last active June 15, 2023 15:55
A list of all my projects
@tterb
tterb / README-badges.md
Last active August 19, 2025 18:32
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active January 26, 2026 19:14
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@ravikiran0606
ravikiran0606 / SP in Unweighted Graph.cpp
Last active January 3, 2021 20:18
Shortest Path in Unweighted Graph : ( Using BFS )
#include<bits/stdc++.h>
using namespace std;
vector< vector<int> >graph;
vector<int>d;
vector<bool>vis;
void bfs(int s){
int t;
@ahmetalsan
ahmetalsan / cosine.py
Last active May 29, 2024 23:44
python cosine similarity algorithm between two strings
import re
import math
from collections import Counter
def get_cosine(vec1, vec2):
intersection = set(vec1.keys()) & set(vec2.keys())
numerator = sum([vec1[x] * vec2[x] for x in intersection])
sum1 = sum([vec1[x]**2 for x in vec1.keys()])
@spudbean
spudbean / gist:1558257
Last active December 8, 2025 19:59
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons