This file contains 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
function copyText(value) { | |
let fakeElem = document.createElement('TEXTAREA') | |
fakeElem.style.position = 'absolute' | |
fakeElem.style.left = '-9999px' | |
fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px' | |
fakeElem.readonly = true | |
fakeElem.value = value | |
document.body.appendChild(fakeElem) | |
fakeElem.focus() | |
fakeElem.setSelectionRange(0, value.length) |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>test</title> | |
<style type="text/css"> | |
div { | |
width: 100px; | |
height: 100px; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload your files</title> | |
</head> | |
<body> | |
<form enctype="multipart/form-data" action="." method="POST"> | |
<p>Upload your file</p> | |
<input type="file" name="uploaded_file"></input><br /> | |
<input type="submit" value="Upload"></input> |
This file contains 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 rm -rf "/Applications/Calendar.app"; | |
sudo rm -rf "/Applications/Chess.app"; | |
sudo rm -rf "/Applications/Contacts.app"; | |
sudo rm -rf "/Applications/DVD Player.app"; | |
sudo rm -rf "/Applications/FaceTime.app"; | |
sudo rm -rf "/Applications/Mail.app"; | |
sudo rm -rf "/Applications/Maps.app"; | |
sudo rm -rf "/Applications/Notes.app"; | |
sudo rm -rf "/Applications/Photo Booth.app"; | |
sudo rm -rf "/Applications/Photos.app"; |
This file contains 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
/** | |
* 在 m.weibo.cn 的 console 里跑 | |
*/ | |
let startPageNo = 1 | |
let pageLength = 90 | |
let delInterval = 1543 | |
let options = { |
This file contains 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 {merge} from 'lodash' | |
const defaultContainerPadding = { | |
top: 0, | |
bottom: 0, | |
left: 0, | |
right: 0 | |
} |
This file contains 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
function smoothScrollTo(selector, duration) { | |
const FPS = 24 | |
let currentScrollY = window.scrollY | |
let targetScrollY = document.querySelector(selector).getBoundingClientRect().top + currentScrollY | |
let deltaY = (targetScrollY - currentScrollY) / (duration * FPS) | |
let interval = 1E3 / FPS | |
let scrollTimer | |
let scrollCallback = [] |
This file contains 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
/** | |
* @file ddns script for dnspod | |
* @author Kyle He | |
*/ | |
const exec = require('child_process').exec; | |
const FormData = require('form-data'); | |
const fetch = require('node-fetch'); | |
(new Promise(function (resolve, reject) { |
This file contains 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
<template> | |
<nav> | |
<ul class="pagination" @click="handleClick($event)"> | |
<li v-if="no > 1"> | |
<a :href="hrefPrefix + (no - 1)" :data-page="no - 1"><</a> | |
</li> | |
<li v-for="i in pageIndicatorSeries" :class="{active: i === no}"> | |
<a :href="hrefPrefix + i" :data-page="i">{{ i }}</a> | |
</li> | |
<li v-if="no < pageCount"> |
This file contains 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
#!/bin/sh | |
# This file should be placed in /jffs/scripts/ folder. | |
# 后台申请token | |
# https://support.dnspod.cn/Kb/showarticle/tsid/227/ | |
login_token='xxxxxxx,yyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | |
# 先调 Domain.List 和 Record.List 接口取得 id | |
# https://www.dnspod.cn/docs/domains.html#domain-list | |
# https://www.dnspod.cn/docs/records.html#record-list |