Skip to content

Instantly share code, notes, and snippets.

View haohanyang's full-sized avatar
🎯
Focusing

Haohan Yang haohanyang

🎯
Focusing
View GitHub Profile
@haohanyang
haohanyang / main.py
Created May 19, 2024 19:37
Get start with LangChain
from langchain_cohere import ChatCohere
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.output_parsers import StrOutputParser
from langchain_community.document_loaders import WebBaseLoader
from langchain_cohere.embeddings import CohereEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain.chains import create_retrieval_chain
@haohanyang
haohanyang / server+1-key.pem
Created September 30, 2023 08:41
Server key
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGj5MyUNDZkbN2
GB4CZow7j5349+QEWxZdprwXtgMn1dY6cPg1ZkE36bploApgJb7Eci/iQmiFDQJx
DSdEVFX08iVNMVAPjejR1a5pC3epKbBmoNiEH2EjyYvPpQA6sXgmj09MA7W7poON
gOP9iFb7ywOh11xLHmT3rHpOJDhXFVlgt2TdP33LKDG87y4KqWpFnScc3wvoLsU5
S9GA/pd6HWbUouTu9VSvs96q9A1yewUhdyGiQAUKqVAUMoo0IQkZQBLl+MpMudbm
RLyGIAB8PqNPojSicx5LqoeS4l04Nre2hxQ+RpaV/CXTojqlUBhtIHpPM8veZZL4
7rI+poVBAgMBAAECggEAOhrFrlGr7B8Q7xv7nCQ6ISvTxIl19jhZgSpLnHysy7lt
qUhpueakayJAY4DDyIMDIiVwEbvxLg4yiraYqQws4zMA62fkz8htOwpWsXKjn6MN
ddrXwUIVgQ13llnoiURpro79W3cydSkzEfOHxCdjnOc5tuB4p5rLXRbh63/55LFb
@haohanyang
haohanyang / angular-fetch.html
Last active August 3, 2023 11:55
Fetch data in angular
<div *ngIf="fetchingError; else fetchingTemplate" class="alert alert-danger" role="alert">
{{ fetchingError }}
</div>
<ng-template #fetchingTemplate>
<div class="spinner-border text-primary" *ngIf="fetching; else dataTemplate" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<ng-template #dataTemplate>
<div class="row">
@haohanyang
haohanyang / ui.html
Last active July 21, 2023 07:35
azure ad b2c ui
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.4.0/mdb.min.css" rel="stylesheet" />
<title>Sign in or sign up</title>
</head>
print "Hello, World!\n";
@haohanyang
haohanyang / effective_modern_cmake.md
Created January 13, 2022 06:58 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@haohanyang
haohanyang / yolov4_mock_data_multiclass_tiny.ipynb
Created March 22, 2021 13:04
Yolov4_mock_data_multiclass_tiny
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@haohanyang
haohanyang / bomblab.md
Last active November 24, 2020 14:42
Bomblab solution record

Bomblab Bombs

phase_1

; Dump of assembler code for function phase_1:
0x0000000000001439 <+0>:     sub    $0x8,%rsp
0x000000000000143d <+4>:     lea    0x1d0c(%rip),%rsi        ; 0x3150
0x0000000000001444 <+11>:    callq  0x1909 <strings_not_equal>
0x0000000000001449 <+16>:    test   %eax,%eax
0x000000000000144b <+18>:    jne    0x1452 <phase_1+25>
0x000000000000144d <+20>:    add    $0x8,%rsp