Skip to content

Instantly share code, notes, and snippets.

View elonzh's full-sized avatar
💝
code with love.

elonzh elonzh

💝
code with love.
  • nanjing
  • 06:04 (UTC +08:00)
  • X @elon2h
View GitHub Profile
@elonzh
elonzh / Move-WSL.ps1
Last active November 13, 2023 16:45
Invoke-Expression (Invoke-WebRequest -Uri "<gist url>").Content && Move-WSL
<#
.SYNOPSIS
Migrate a specified WSL (Windows Subsystem for Linux) distribution to a new location.
.DESCRIPTION
The Move-WSL function terminates, exports, unregisters, and re-imports a specified WSL distribution to a new location. This is useful for moving the distribution to a different drive or directory.
.PARAMETER Distro
The name of the WSL distribution that you want to move. This parameter is mandatory.
@elonzh
elonzh / django_json_readonly_widget.html
Last active June 9, 2023 22:55
django-json-readonly-widget
<div {% if not widget.attrs.style %}style="height:{{widget.height|default:'500px'}};width:{{widget.width|default:'90%'}};display:inline-block;"{% endif %}{% include "django/forms/widgets/attrs.html" %}></div>
<script>
(function() {
var container = document.getElementById("{{ widget.attrs.id }}");
var options = {{ widget.options|safe }};
options.onModeChange = function (newMode, oldMode) {
if (newMode === 'code') {
editor.aceEditor.setReadOnly(true);
<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title level="a" type="main">Trace-based Just-in-Time Type Specialization for Dynamic Languages</title>
</titleStmt>
<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title level="a" type="main">Investigation of isospin-triplet and isospin-singlet pairing in the A=10 nuclei B10,Be10 , and C10 with an extension of the Tohsaki-Horiuchi-Schuck-Röpke wave function</title>
</titleStmt>
<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
xmlns:xlink="http://www.w3.org/1999/xlink">
<teiHeader xml:lang="en">
<fileDesc>
<titleStmt>
<title level="a" type="main">Investigation of isospin-triplet and isospin-singlet pairing in the A = 10 nuclei 10 B, 10 Be, and 10 C with an extension of the Tohsaki-Horiuchi-Schuck-Röpke wave function</title>
</titleStmt>
Title Subject Author
Set 2: MCHS versus MBHS groups Est
PowerPoint Presentation Douglas G. Hohensee
Extracellular vesicles: biology and emerging therapeutic opportunities Nature Reviews Drug Discovery 12, 347 (2013). doi:10.1038/nrd3978 Samir EL Andaloussi
The Development of Numerical Credit Evaluation Systems
Payday Loans and Credit Cards: New Liquidity and Credit Scoring Puzzles?
3D printing of bone tissue engineering scaffolds Bioactive Materials, 5 (2020) 82-91. doi:10.1016/j.bioactmat.2020.01.004 Chong Wang
APIS: Privacy-Preserving Incentive for Sensing Task Allocation in Cloud and Edge-Cooperation Mobile Internet of Things With SDN IEEE Internet of Things Journal;2020;7;7;10.1109/JIOT.2019.2954380
Microsoft Word - Paper_revised.docx School
Dynamic Programming and Markov Processes by Ronald A. Howard
@elonzh
elonzh / download_files.sh
Created May 27, 2021 09:09
Download files from urls with mirror support.
#!/usr/bin/env bash
# Download files from urls with mirror support.
set -e
ARCH="amd64"
BASEDIR=$(dirname "${0}")
GHPROXY_URL="https://elonzh.ghproxy.workers.dev"
download_tmp='/tmp/download_cache'
download_dir=${BASEDIR}/downloads
url_pattern='(https?:\/\/)(github\.com|google\.com|releases\.rancher\.com|storage\.googleapis\.com|get\.docker\.com|get\.helm\.sh)(\b[-a-zA-Z0-9()!@:%_\+.~#?&\/\/=$\{\}]*)'
#!/usr/bin/env bash
set -x
# FIXME: check CAP_NET_ADMIN
# if [ "$EUID" -ne 0 ]
# then echo "Please run as root"
# exit 1
# fi
SCRIPT_ROOT="$(realpath "$(dirname "${BASH_SOURCE}")")"
@elonzh
elonzh / install_xpdf.sh
Last active November 27, 2024 10:47
intall xpdf tools and language packages
#!/usr/bin/env bash
#see http://www.xpdfreader.com/download.html, read the README in archive file for more instructions
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
set -eux
url="https://dl.xpdfreader.com/xpdf-tools-linux-4.03.tar.gz"
@elonzh
elonzh / init.gradle
Last active March 10, 2021 07:30
using maven mirrors
// gradle/wrapper/gradle-wrapper.properties distributionUrl=http://downloads.gradle-dn.com/distributions/<version>.zip
// gradle/wrapper/gradle-wrapper.properties distributionUrl=https://mirrors.cloud.tencent.com/gradle/<version>.zip
def mavenMirrors = [
'https://repo.maven.org/maven2' : 'https://maven.aliyun.com/nexus/content/groups/public',
'https://repo.maven.apache.org/maven2' : 'https://maven.aliyun.com/nexus/content/groups/public',
'https://jcenter.bintray.com' : 'https://maven.aliyun.com/nexus/content/repositories/jcenter',
'https://maven.google.com' : 'https://maven.aliyun.com/repository/google',
'https://plugins.gradle.org/m2' : 'https://maven.aliyun.com/repository/gradle-plugin',
'https://repo.spring.io/libs-milestone': 'https://maven.aliyun.com/repository/spring',
]