This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PASSWORD = 'helloworld'; | |
export default { | |
async fetch(request) { | |
const { searchParams } = new URL(request.url); | |
const target = searchParams.get('url'); | |
const key = searchParams.get('psw'); | |
if (PASSWORD && key !== PASSWORD) { | |
return new Response('Unauthorized', { status: 401 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import csv | |
import time | |
import json | |
import random | |
import pandas as pd | |
from tqdm import tqdm | |
from google import genai | |
import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import concurrent.futures | |
import pandas as pd | |
from tqdm import tqdm | |
from pathlib import Path | |
from datasets import load_dataset | |
from transformers import AutoTokenizer | |
data_path = "/data/" | |
model_path = "meta-llama/Llama-3.2-1B-Instruct" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A scholar metadata provider for calibre-web, based on the Cross Ref API(https://github.com/fabiobatalha/crossrefapi) | |
Author: Terence Lau | |
LICENSE: MIT | |
''' | |
import itertools | |
from typing import Dict, List, Optional | |
from urllib.parse import quote, unquote |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
derper: | |
container_name: derper | |
image: <domain-name>/fredliang/derper:latest | |
ports: | |
- '<port-for-derp>:<port-for-derp>' | |
- '3478:3478/udp' | |
environment: | |
- DERP_DOMAIN=derp.rho.ac.cn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torchvision | |
import numpy as np | |
## U-Net ## | |
class DualConv(nn.Module): | |
def __init__(self, in_channel, out_channel): | |
super(DualConv, self).__init__() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules: | |
## Acadamic | |
- DOMAIN-SUFFIX,acm.org,DIRECT | |
- DOMAIN-SUFFIX,acs.org,DIRECT | |
- DOMAIN-SUFFIX,aip.org,DIRECT | |
- DOMAIN-SUFFIX,ams.org,DIRECT | |
- DOMAIN-SUFFIX,annualreviews.org,DIRECT | |
- DOMAIN-SUFFIX,aps.org,DIRECT | |
- DOMAIN-SUFFIX,ascelibrary.org,DIRECT | |
- DOMAIN-SUFFIX,asm.org,DIRECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo modprobe overlay && sudo modprobe br_netfilter | |
cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf | |
overlay | |
br_netfilter | |
EOF | |
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf | |
net.bridge.bridge-nf-call-iptables = 1 | |
net.ipv4.ip_forward = 1 | |
net.bridge.bridge-nf-call-ip6tables = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
outline: | |
image: outlinewiki/outline | |
env_file: ./docker.env | |
command: sh -c "yarn sequelize:migrate --env production-ssl-disabled && yarn start" | |
ports: | |
- "3000:3000" | |
depends_on: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torch import nn | |
def CausalConv1d(in_channels, out_channels, kernel_size, dilation=1, **kwargs): | |
pad = (kernel_size - 1) * dilation + 1 | |
return nn.Conv1d(in_channels, out_channels, kernel_size, padding = pad, dilation = dilation, **kwargs) | |
def CasalConv2d(in_channels, out_channels, kernel_size, dilation=1, **kwargs): | |
pad = (kernel_size - 1) * dilation + 1 | |
return nn.Conv2d(in_channels, out_channels, kernel_size, padding = pad, dilation = dilation, **kwargs) |
NewerOlder