Skip to content

Instantly share code, notes, and snippets.

View TerenceLiu98's full-sized avatar
🌞
Working

TerenceLau TerenceLiu98

🌞
Working
View GitHub Profile
'''
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
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
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__()
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
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
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:
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)
#### AUTOMATIC TUNNEL WITH CLOUDFLARE SCRIPT ####
jupyterhub & cloudflared tunnel --url http://localhost:8000
code-server --auth=none -p 8001 & cloudflared tunnel --url http://localhost:8001
#!/bin/bash
function loadFile(){
mysql -u"[USERNAME]" -p"[USERNAME]" --local-infile=1 [DATABASE_NAME] << EOF
SET GLOBAL local_infile = 'ON';
LOAD DATA LOCAL INFILE "$1" INTO TABLE $2
COLUMNS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY '\n'
from __future__ import print_function
from __future__ import unicode_literals
import os
import io
import time
import requests
import argparse
import zipfile
__author__ = 'John Beieler, johnbeieler.org'