Skip to content

Instantly share code, notes, and snippets.

View OMGZui's full-sized avatar
:octocat:
Focusing

omgzui OMGZui

:octocat:
Focusing
  • DXY
  • HangZhou, China
View GitHub Profile
@OMGZui
OMGZui / defaultValues.java
Last active June 3, 2022 07:35
2 ways to implement arguments with default values in Java methods
public class Foo {
private final String a;
private final Integer b;
public Foo(String a, Integer b) {
this.a = a;
this.b = b;
}
}
:root {
--bg: #000;
--primary: #70233b;
--control: #d5d8dd;
}
.head {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 250px;
height: 250px;
border-radius: 50%;
border: 10px solid var(--primary);
background-image: repeating-conic-gradient(
.head .front {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: 96%;
height: 96%;
margin: auto;
background: -webkit-linear-gradient(top, transparent 20px, var(--bg) 21px),
.fan-main {
position: relative;
width: 100%;
height: 100%;
}
.fan-item {
position: absolute;
top: 39px;
left: 100px;
width: 50px;
.control {
position: relative;
width: 100px;
height: 0px;
border-top: 0px;
border-right: 25px solid transparent;
border-bottom: 90px solid var(--primary);
border-left: 25px solid transparent;
margin-top: -10px;
}
# html
<div class="control-main">
<div :class="`control-item control-item-${control}`" @click="changeControl"></div>
<div class="control-item"></div>
</div>
## js
changeControl() {
if (this.control < 3) {
this.control++;
} else {
CREATE TABLE `doc` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`position` int(11) DEFAULT '0' COMMENT 'position',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
UPDATE doc SET position = position + 1 WHERE position >= #{newPosition}
SELECT * FROM doc ORDER BY position ASC;