Skip to content

Instantly share code, notes, and snippets.

@acutmore
acutmore / _web-framework-render-fns.md
Last active May 6, 2024 16:31
Comparing web framework render functions
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 16:30
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@rahulkangjam
rahulkangjam / gist:d061737c15fc58260d3f
Created November 4, 2014 06:53
New Facebook Auto Follower 2014 2015 Working Script For Greasemonkey
// ==UserScript==
// @name Facebook New Auto Follower 2014 + 2015
// @namespace Facebook AutoFollower + Auto Like
// @description Facebook AutoFollower Script For Greasemonkey
// @version 1.0.11
// @include https://*.facebook.com/*
// @include https://*.facebook.com/*/*
// @include http://*.facebook.com/*
// @include http://*.facebook.com/*/*
// ==/UserScript==
@ssrihari
ssrihari / clojure-learning-list.md
Last active May 6, 2024 16:25
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@GodderE2D
GodderE2D / discord_official_domains.md
Created September 7, 2021 09:48
List of Discord Official Web Domains

Discord Official Web Domains

Listed below are the web domains that Discord currently own. If you see a link sending you to a domain that claims is a "Discord owned website", check if it is one of the below domain names! If it's not, assume it's a scam and report it.

Note: This is not an exhaustive list, there may be some missing domains that Discord owns, but there are no domains listed here that aren't owned by Discord.

@nosmall
nosmall / Win_Server_2022_Evaluation_to_full_version.md
Created April 16, 2023 11:11
Upgrade Windows Server 2022 Evaluation (Eval) to Full Version Standard or Datacenter
@pabloviera15
pabloviera15 / stuns
Created December 16, 2020 00:33 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@mlabonne
mlabonne / merge_peft.py
Last active May 6, 2024 16:20
Merge base model and peft adapter and push it to HF hub
# Example usage:
# python merge_peft.py --base_model=meta-llama/Llama-2-7b-hf --peft_model=./qlora-out --hub_id=alpaca-qlora
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import argparse
def get_args():