Skip to content

Instantly share code, notes, and snippets.

View NateScarlet's full-sized avatar
🍔
LiangMianBaoJiaZhiShi

NateScarlet NateScarlet

🍔
LiangMianBaoJiaZhiShi
View GitHub Profile
@NateScarlet
NateScarlet / NetCheck.ahk
Last active August 22, 2016 07:55
托盘显示网络连通性
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;~ if not A_IsAdmin ;确保管理员权限
;~ {
;~ Run *RunAs "%A_ScriptFullPath%" ; 需要 v1.0.92.01+
;~ ExitApp
;~ }
CoordMode, Mouse, Client
@NateScarlet
NateScarlet / SNJYW_ed_loop.ntp
Created February 11, 2017 16:09
[Natron工程]《少年锦衣卫》ed循环
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<Background_project>0</Background_project>
<Project class_id="0" tracking_level="0" version="6">
<VersionMajor>2</VersionMajor>
<VersionMinor>2</VersionMinor>
<VersionRev>4</VersionRev>
<GitBranch>tags/2.2.4</GitBranch>
<GitCommit>cb4c91a919d6b00bf9d44f6e68e369eac06d14ac</GitCommit>
@NateScarlet
NateScarlet / sudo.cmd
Last active February 21, 2019 14:20
Sudo for windows
CALL :SUDO %*
GOTO :EOF
:SUDO
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "Start-Process -Wait -FilePath powershell.exe -ArgumentList @('-NoProfile', '-InputFormat', 'None', '-ExecutionPolicy', 'Bypass', '-Command', 'cd', '%cd%', ';', """%*""") -verb RunAs"
GOTO :EOF
@NateScarlet
NateScarlet / postchangelog.sh
Created April 4, 2019 10:54
conventional-changelog temp fix
#!/bin/bash
sed -e '2,${s/^# /## /}' -e 's/Change Log/Changelog/' -i CHANGELOG.md
npx prettier --write CHANGELOG.md
@NateScarlet
NateScarlet / termux-install-jupyterlab.sh
Created April 10, 2019 13:29
termux-install-jupyterlab
#!/bin/sh
pkg install clang python-dev libzmq libzmq-dev
pip install jupyterlab
@NateScarlet
NateScarlet / 10-setup_mirror.sh
Last active April 12, 2019 03:03
boot2docker(tinycore) cn locale setup 设置中国本地化
#!/bin/sh
echo http://mirrors.163.com/tinycorelinux/ | sudo tee /opt/tcemirror
echo '[global]
index-url = https://mirrors.aliyun.com/pypi/simple' | sudo tee /etc/pip.conf
@NateScarlet
NateScarlet / ModalMixin.ts
Last active January 9, 2020 09:28
element-ui modal show
import { Component, Prop, Vue } from 'vue-property-decorator';
/**
* Mixin for support `dialog.show`
*/
@Component
export class ModalMixin extends Vue {
@Prop({ default: false, type: Boolean })
public visible!: boolean;
@NateScarlet
NateScarlet / useVirtualScroll.ts
Last active June 8, 2023 10:12
vue composable for implement virtual scroll on x or/and y axis
import type { StyleValue } from 'vue';
import { computed, reactive, ref } from 'vue';
export default function useVirtualScroll({
x,
y,
}: {
x?: {
totalCount: () => number;
itemWidth: () => number;
@NateScarlet
NateScarlet / html-webpack-stats,js
Last active April 4, 2020 15:30
Use html-webpack-plugin to generate stats.json
new HtmlPlugin({
/** @param {{compilation: import('webpack').compilation.Compilation}} */
templateContent: ({ compilation }) => {
const {
hash,
publicPath,
assetsByChunkName,
assets,
} = compilation.getStats().toJson({ all: true }, true);
return JSON.stringify(
export function getCommonPrefix(v: string[]): string {
if (v.length === 0) {
return '';
}
if (v.length === 1) {
return v[0];
}
// return range is [0, w)
let w = v[0].length;