Skip to content

Instantly share code, notes, and snippets.

View ShawnRong's full-sized avatar
🎱
Focusing

ShawnRong ShawnRong

🎱
Focusing
View GitHub Profile
@ShawnRong
ShawnRong / data-ingestion.ts
Created July 8, 2023 02:52
Create milvus vector database with Docker
import { PDFLoader } from "langchain/document_loaders/fs/pdf";
import { DirectoryLoader } from "langchain/document_loaders/fs/directory";
import { RecursiveCharacterTextSplitter } from "langchain/text_splitter";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { Milvus } from "langchain/vectorstores/milvus";
const docsFolder = "./law-docs"
export const dataIngestion = async () => {
try {
" so ~/.vim/plugins.vim
syntax enable
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader=',' "The default leader is \, but a comma is much better.
set number "Let's activate line numbers.
set linespace=10 "Maccim-specific line-height"
set noerrorbells visualbell t_vb= "No bell
set shiftwidth=4 " number of spaces to use for autoindenting
@ShawnRong
ShawnRong / .zhrc
Created March 20, 2018 02:07
zsh config
#export PATH="~/.composer/vendor/bin:vendor/bin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# ## change iterm window tab grey color
# echo -e "\033]6;1;bg;red;brightness;40\a"
# echo -e "\033]6;1;bg;green;brightness;44\a"
# echo -e "\033]6;1;bg;blue;brightness;52\a"
# Set name of the theme to load.
@ShawnRong
ShawnRong / strategy.py
Created January 27, 2018 14:53
stock strategy
import numpy as np
import talib
import pandas
import scipy as sp
import scipy.optimize
import datetime as dt
from scipy import linalg as sla
from scipy import spatial
from jqdata import gta
@ShawnRong
ShawnRong / withErrorHandelr.js
Created December 29, 2017 02:47
React axios highorder error handler component
import React, { Component } from 'react'
import Modal from '../../components/UI/Modal/Modal'
import Auxiliary from '../Auxiliary/Auxiliary'
const withErrorHandler = (WrappedComponent, axios) => {
return class extends Component {
constructor(props) {
super(props)
this.state = {
error: null
" so ~/.vim/plugins.vim
syntax enable
set backspace=indent,eol,start "Make backspace behave like every other editor.
let mapleader=',' "The default leader is \, but a comma is much better.
set number "Let's activate line numbers.
set linespace=10 "Maccim-specific line-height"
set noerrorbells visualbell t_vb= "No bell
set shiftwidth=4 " number of spaces to use for autoindenting
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'sheerun/vim-polyglot'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
"nvim plugin settting
let g:nvim_fancy_font = 0
let g:nvim_bundle_groups = ['ui', 'enhance', 'move', 'navigate',
\'complete', 'compile', 'git', 'language']
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"---------------------------------------------------------------------------------------------------
" => General
"---------------------------------------------------------------------------------------------------
{
"editor.tabSize": 2,
"workbench.colorCustomizations": {
"statusBar.background": "#005f87",
"statusBar.noFolderBackground": "#005f87",
"statusBar.debuggingBackground": "#005f87"
},
"vim.enableNeovim": true,
"workbench.colorTheme": "Cobalt2",
"workbench.panel.location": "right",
@ShawnRong
ShawnRong / index.html
Last active October 19, 2017 09:09 — forked from anonymous/index.html
企业首页// source http://js.jirengu.com/xolureheqo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
@font-face {
font-family: 'iconfont'; /* project id 445228 */
src: url('//at.alicdn.com/t/font_445228_b28j287bu39885mi.eot');