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
package com.example.conf | |
import io.lettuce.core.RedisClient | |
import io.lettuce.core.RedisURI | |
import org.slf4j.LoggerFactory | |
import java.io.FileOutputStream | |
import java.lang.reflect.UndeclaredThrowableException | |
import java.nio.ByteBuffer | |
import java.nio.file.Paths | |
import java.time.Duration |
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
Array.prototype.zip = function(ano) { | |
return [...Array(Math.min(this.length, ano.length))].map((_, i) => [this[i], ano[i]]); | |
} |
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 getSessionItem(key, remove) { | |
if (!key) { | |
throw new Error(`invalid key: ${key}`); | |
} | |
if (remove === undefined) { | |
remove = true; | |
} | |
let o = window.sessionStorage.getItem(key); | |
if (!o && window.opener) { | |
o = window.opener.sessionStorage.getItem(key); |
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
<el-form :model="formModel" :rules="rules" ref="form"> | |
<el-form-item label="活动名" prop="activity_title"> | |
<el-input v-model="formModel.activity_title" /> | |
</el-form-item> | |
</el-form> | |
import Joi from "@hapi/joi"; | |
import { validator } from "./validator.js"; | |
export default { |
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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>TagIndicator</title> | |
<style> | |
ul > li { | |
list-style: none; | |
display: inline-block; | |
padding: 5px 8px; |
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
export function spawn<T>( | |
isValid: (value: T) => boolean, | |
msg: string, | |
options?: any, | |
) { | |
return { | |
required: true, | |
trigger: "blur", | |
...options, | |
validator: (_: any, val: T, callback: Function) => { |
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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Sticky overlap title example</title> | |
<style> | |
.sticky-title { | |
position: sticky; | |
top: 2em; | |
color: goldenrod; |
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 logo from "./logo.svg"; | |
import "./App.css"; | |
import { useEffect } from "react"; | |
let prevTimestamp: null | number = null; | |
let duration = 0; | |
let animationID = -1; | |
function rotateLogo(timestamp: number) { | |
if (prevTimestamp === null) { |
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
type PropName = string; | |
type DateName = string; | |
export type PropDataNames = [PropName, DateName]; | |
export function syncState(...tuples: PropDataNames[]) { | |
const watcher = {} as { [index: string]: (v: any) => void }; | |
for (const tuple of tuples) { | |
const [propName, dataName] = tuple; |
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
#[derive(PartialEq, Eq, Clone, Debug)] | |
pub struct ListNode { | |
pub val: i32, | |
pub next: Option<Box<ListNode>>, | |
} | |
impl ListNode { | |
#[inline] | |
fn new(val: i32) -> Self { | |
ListNode { next: None, val } |
OlderNewer