This file contains hidden or 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 xattr -r -d com.apple.quarantine /Applications/SomeApp/ |
This file contains hidden or 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 lombok.SneakyThrows; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.context.event.ApplicationReadyEvent; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.event.EventListener; | |
import org.springframework.data.mongodb.core.MongoTemplate; | |
import org.springframework.data.mongodb.core.convert.MappingMongoConverter; | |
import org.springframework.data.mongodb.core.index.IndexOperations; | |
import org.springframework.data.mongodb.core.index.MongoPersistentEntityIndexResolver; | |
import org.springframework.data.mongodb.core.mapping.Document; |
This file contains hidden or 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
@ExtendWith(SpringExtension.class) | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | |
public class IntegrationTest { | |
@LocalServerPort | |
protected int port; | |
@Autowired | |
protected ObjectMapper objectMapper; |
This file contains hidden or 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
$width: 70px; | |
.circle { | |
display: inline-block; | |
position: relative; | |
text-align: center; | |
width: $width; | |
height: $width; | |
margin-right: 20px; |
This file contains hidden or 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
<css-doodle click-to-update> | |
<style> | |
@grid: 80x1 / 80vmin; | |
@size: @rn(0, 100%, 5); | |
@offset: @plot(r: .5); | |
@random(.3) { filter: blur(2px) } | |
background-size: 35%; | |
background-image: @svg( | |
viewBox: 0 0 10 10; | |
circle { |
This file contains hidden or 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
select s.id, t.* | |
from service_groups s | |
join ( | |
select short_name, service_id, count(*) as qty | |
from service_groups | |
group by short_name, service_id | |
having count(*) > 1 | |
) t on s.short_name = t.short_name and s.service_id = t.service_id; |
This file contains hidden or 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
const range = (start, end, includeEnd=false) => Array.from({ length: end - start + (includeEnd ? 1 : 0) }, (_, i) => i + start); |
This file contains hidden or 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
const mailRegExp = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.?[a-zA-Z]*$/; | |
mailRegExp.test("a@a") | |
// true | |
mailRegExp.test("a!@a") | |
// false | |
mailRegExp.test("a!@a/x") | |
// false | |
mailRegExp.test("[email protected]") | |
// true |
This file contains hidden or 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
public class BaseException extends RuntimeException { | |
public BaseException(String message) { | |
super(message); | |
} | |
protected boolean suppressStackTrace() { | |
return false; | |
} |
This file contains hidden or 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
colima start | |
docker run --detach --name some-mariadb --env MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 mariadb:latest | |
docker exec -it some-mariadb bash | |
mariadb | |
CREATE DATABASE test; | |
USE test; | |
CREATE TABLE users( | |
id int NOT NULL AUTO_INCREMENT, | |
name varchar(100), |