Skip to content

Instantly share code, notes, and snippets.

View Hansanghyeon's full-sized avatar
🎯

999 Hansanghyeon

🎯
View GitHub Profile
@Hansanghyeon
Hansanghyeon / classname.md
Created April 18, 2022 23:42
유용한 regex
(?:class|className)=(?:["']\W+\s*(?:\w+)\()?["']([^'"]+)['"]
@Hansanghyeon
Hansanghyeon / swarm.md
Created April 18, 2022 21:45
docker swarm
docker stack deploy -c <(docker-compose -f docker-compose.yaml config) {stack name}
<?php
/**
* Prevent update notification for plugin -
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Add to the core plugin file
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
$plugin_file_name = basename(__DIR__) . '/' . basename(__FILE__);
if ( isset( $value->response[$plugin_file_name] ) ) {
@Hansanghyeon
Hansanghyeon / subdir-loader.php
Created October 22, 2021 06:54 — forked from richardtape/subdir-loader.php
Allow WordPress-MU plugins to be loaded automatically from a sub directory
<?php
/**
* Plugin Name: MU plugins subdirectory loader
* Plugin URI: http://code.ctlt.ubc.ca
* Description: Enables the loading of plugins sitting in mu-plugins (as folders)
* Version: 0.1
* Author: iamfriendly, CTLT
* Author URI: http://ubc.ca/
*
@Hansanghyeon
Hansanghyeon / Makefile
Created October 15, 2021 06:49
develop, release, main branch git flow
test:
git push upstream release/$v
release:
git commit -m ":memo: $v changelog"
git checkout main
git merge --no-ff release/$v -m ":bookmark: $v"
git tag -a $v -m "Release $v"
git checkout develop
git merge --no-ff release/$v -m ":bookmark: merge $v to develop"
git push origin develop
@Hansanghyeon
Hansanghyeon / accordion.scss
Created June 22, 2021 05:55
[ui] accordion css
// base
.target {
max-height: 0;
}
@keyframes accordionIn {
0% {
opacity: 0;
transform: scale(0.9) rotateX(-60deg);
@Hansanghyeon
Hansanghyeon / scroll.scss
Created June 22, 2021 05:24
[ui] scroll
&::-webkit-scrollbar {
height: 3px;
}
&::-webkit-scrollbar-track {
background-color: #fff;
}
&::-webkit-scrollbar-thumb {
background: #ddd;
border-radius: 10px;
}
@Hansanghyeon
Hansanghyeon / _textDecoration.scss
Created June 19, 2021 09:33
[scss] textDecoration
@mixin textDecoration($bg: var(--bg0), $color: currentColor, $space: 2px) {
// box-shadow & text-shdaow를 이용한 text-decoration 구성
// 참고: https://codepen.io/999hyeon/pen/QWpVOgL
text-shadow: -#{$space} -#{$space} #{$bg}, -#{$space} #{$space} #{$bg},
#{$space} -#{$space} #{$bg}, #{$space} #{$space} #{$bg};
box-shadow: inset 0 -0.05em #{$bg}, inset 0 -0.1em #{$color};
display: inline;
}
@mixin gap($size: 1em, $direction: y) {
--gap: #{$size};
@supports (gap: var(--gap)) {
gap: var(--gap);
}
@supports not (gap: var(--gap)) {
> *:not(:last-child) {
@if $direction == x {
margin-right: var(--gap);
}
@Hansanghyeon
Hansanghyeon / gist:7c87acac843c84809b0407adcc63d985
Created June 13, 2021 11:48
[regex] html attribute 선택
(id|class)="[^"]+"