Skip to content

Instantly share code, notes, and snippets.

View DeruiDENG's full-sized avatar
🎨
Drawing the world

Derui DENG DeruiDENG

🎨
Drawing the world
  • Thoughtworks
  • China
View GitHub Profile
@DeruiDENG
DeruiDENG / load-nvmrc.sh
Last active December 26, 2023 03:28
A shell script which can help the nvm to detect .nvmrc and .node_version file
#!/bin/bash
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ ! -e "${nvmrc_path}" ]; then
local LOCAL_NODE_VERSION_DOTFILE_PATH
LOCAL_NODE_VERSION_DOTFILE_PATH="${PWD}/.node-version"
if [ -e "${LOCAL_NODE_VERSION_DOTFILE_PATH}" ]; then
<scheme name="Atom One Dark" version="142" parent_scheme="Darcula">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2023-06-20T08:52:34</property>
<property name="ide">WebStorm</property>
<property name="ideVersion">2023.1.2.0.0</property>
<property name="modified">2023-06-20T08:52:47</property>
<property name="originalScheme">_@user_Atom One Dark</property>
</metaInfo>
<option name="LINE_SPACING" value="1.2" />
@DeruiDENG
DeruiDENG / continueLearn.js
Created November 19, 2022 13:52
continue learn
function continueLearn() {
const continueButton = document.querySelector('body .person > .personal-classcenter iframe')?.contentDocument.querySelector('.layui-layer-content iframe')?.contentDocument.querySelector('button');
if (continueButton) {
console.log("Click continue button!");
continueButton.click();
} else {
console.log("Continue button not found!")
}
const playButton = document.querySelector('body .person > .personal-classcenter iframe')?.contentDocument.querySelector('.qplayer-play.qplayer-active');

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
@DeruiDENG
DeruiDENG / keepAlive.sh
Created May 3, 2019 03:54
A shell script that can integrate with crontab to keep ss container alive
#!/bin/sh
ssContainer=""
get_ss_container(){
ssContainer="$(sudo docker container list --all | grep shadowsocks)"
}
# Return 0 if ssContianer is UP
get_ss_status()
{
isUp="$(echo $ssContainer | grep Up)"