Skip to content

Instantly share code, notes, and snippets.

@RagtagGeoduck
RagtagGeoduck / base.css
Created May 1, 2021 07:32
[按钮样式] #CSS
/*base*/
body {
background: #fff;
}
.btn {
display: inline-block;
padding: 4px 12px;
margin-bottom: 0;
font-size: 14px;
@RagtagGeoduck
RagtagGeoduck / 15.05-自定义滚动条+滚轮事件.html
Last active February 20, 2021 03:37
[自定义滚动条+滚轮事件]#JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>自定义滚动条</title>
<link rel="stylesheet" href="./css/reset.css">
<link rel="stylesheet" href="./css/1503style.css">
</head>
<body>
<div id="wrap">
@RagtagGeoduck
RagtagGeoduck / Mac-dock
Last active February 20, 2021 03:27
[Mac常用技巧]
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
killall Dock
@RagtagGeoduck
RagtagGeoduck / reset.css
Created February 20, 2021 03:18
[reset.css]css重制
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@RagtagGeoduck
RagtagGeoduck / 1111style.css
Last active February 20, 2021 03:41
[轮播图]P3415.06-轮播图按钮 #JavaScript
img {
display: block;
}
html,
body {
height: 100%;
overflow: hidden;
}
.banner {
position: relative;
@RagtagGeoduck
RagtagGeoduck / list.py
Last active March 11, 2020 05:10
[Python反转list的三种方法] 对列表的内容进行倒置 #Python
list(reversed(a)) #reversed(a)返回的是迭代器,所以前面加个list转换为list
sorted(a,reverse=True)
a[: :-1] #其中[::-1]代表从后向前取值,每次步进值为1
"""
普通算数操作符
现在我们仅仅覆盖了普通的二进制操作符:+,-,*和类似符号。这些符号大部分来说都浅显易懂。
__add__(self, other) 实现加法。
__sub__(self, other) 实现减法。
__mul__(self, other) 实现乘法。
__floordiv__(self, other) 实现 // 符号实现的整数除法。
__div__(self, other) 实现 / 符号实现的除法。
__truediv__(self, other) 实现真除法。
@RagtagGeoduck
RagtagGeoduck / gcd.py
Last active February 20, 2021 03:33
[欧几里得算法] #Python #算法
def gcd(m, n):
if n == 0:
m, n = n, m
while m != 0:
m, n = n%m, m
return n
"""
最著名的寻找最大公因数的方法是欧几里得算法.
欧几里得算法规定: