In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| #Install Gource in Ubuntu | |
| ======================== | |
| #Go to the folder.... and | |
| #see http://tylerfrankenstein.com/code/install-gource-ubuntu-1010-visualize-git-repo | |
| # https://github.com/acaudwell/Gource/releases/download/gource-0.49/gource-0.49.tar.gz | |
| sudo apt-get update | |
| sudo apt-get install libglew-dev | |
| sudo apt-get install libsdl2-dev | |
| sudo apt install libsdl2-image-dev |
| import os | |
| import re | |
| import sys | |
| import glob | |
| import nltk | |
| import gensim | |
| import numpy as np | |
| import pandas as pd | |
| from tqdm import tqdm | |
| from uuid import uuid4 |
| # This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py), | |
| # adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs. | |
| # | |
| # Usage: | |
| # - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate` | |
| # - Install deepspeed: `pip install deepspeed==0.9.5` | |
| # - Install TRL from main: pip install git+https://github.com/huggingface/trl.git | |
| # - Clone the repo: git clone github.com/huggingface/trl.git | |
| # - Copy this Gist into trl/examples/scripts | |
| # - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py |
| Option Explicit | |
| Private Function XLMod(a, b) | |
| 'สำหรับใช้แทน mod ของ vba เนื่องจาก mod operator ของ vba ไม่รองรับเลขทศนิยม | |
| XLMod = a - b * Int(a / b) | |
| End Function | |
| Function AthikaMas(iYear As Integer) As Boolean | |
| 'สูตรสำหรับคำนวณปีอธิกมาส | |
| 'Return True if the specified year is AthikaMas. |
| import re | |
| from collections import defaultdict | |
| from marisa_trie import Trie | |
| wordlist = [li.strip() for li in open('wordlist.txt')] | |
| trie = Trie(wordlist) # สร้างครั้งเดียว ข้างนอก function | |
| class LatticeString(str): | |
| ''' String subclass เพื่อเก็บวิธีตัดหลายๆ วิธี | |
| ''' |