Skip to content

Instantly share code, notes, and snippets.

View Hansanghyeon's full-sized avatar
🎯

999 Hansanghyeon

🎯
View GitHub Profile
@Hansanghyeon
Hansanghyeon / table.html
Created May 28, 2021 07:20
[html] 테이블 넓이 지정
<table style="width: 100%">
<colgroup>
<col span="1" style="width: 15%;">
<col span="1" style="width: 70%;">
<col span="1" style="width: 15%;">
</colgroup>
<!-- Put <thead>, <tbody>, and <tr>'s here! -->
<tbody>
<tr>
<td style="background-color: #777">15%</td>
@Hansanghyeon
Hansanghyeon / heredoc-function.php
Created March 3, 2021 08:33 — forked from Pephers/heredoc-function.php
How to call a PHP function inside a Heredoc.
<?php
$cb = function ($fn) {
return $fn;
};
echo <<<HEREDOC
Hello, {$cb(ucfirst('world'))}
HEREDOC;
@Hansanghyeon
Hansanghyeon / functions.php
Created February 7, 2021 12:19
[wp] 현재 페이지에서 네비게이션 부모 쿼리 가져오기
<?php
/**
* 현재 페이지에서 네비게이션 부모 쿼리 가져오기 함수
*
* @author Hansanghyeon
* @copyright Hansanghyeon <[email protected]>
**/
function my_menu_parent($theme_location)
@Hansanghyeon
Hansanghyeon / functions.php
Last active February 7, 2021 07:46
[wp] Archive 페이지에서 게시판 스타일
<?php
$postType = get_post_type();
if (!empty($postType)) {
add_action('pre_get_posts', function ($query) {
if (
!is_admin()
&& $query->is_post_type_archive(get_post_type())
&& $query->is_main_query()
) {
@Hansanghyeon
Hansanghyeon / storybook-tsconfig.md
Created January 20, 2021 06:19
[storybook] [tsconfig] tsconfig-path 플러그인 적용오류

어떤 이유로 리졸 브 플러그인이 확장되지 않은 것처럼 보입니다. 따라서 TsconfigPathsPlugin을 사용하여 TS 경로의 별칭을 가져 오는 경우 스토리 북 웹팩 구성 파일에서 별칭을 다시 정의해야합니다.

config.resolve.plugins = [
  new TsconfigPathsPlugin({
    configFile: path.resolve(__dirname, "../tsconfig.json")
  })
];
@Hansanghyeon
Hansanghyeon / craco.config.js
Created January 20, 2021 06:01
[CRA][craco] tsconfig-paths-webpack-plugin
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
plugins: [
...
{
plugin: {
overrideWebpackConfig: ({ webpackConfig }) => {
webpackConfig.resolve.plugins.push(new TsconfigPathsPlugin({}));
return webpackConfig;
@Hansanghyeon
Hansanghyeon / functions.php
Created January 18, 2021 05:54
[wp] 현재페이지의 서브메뉴 훅
<?php
// add hook
add_filter( 'wp_nav_menu_objects', 'my_wp_nav_menu_objects_sub_menu', 10, 2 );
// filter_hook function to react on sub_menu flag
function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) {
if ( isset( $args->sub_menu ) ) {
$root_id = 0;
// find the current menu item
@Hansanghyeon
Hansanghyeon / killTheme.php
Created January 17, 2021 11:44
[wp] kill Theme
<?php
/**
* Kill Themes
*
* @author Hansanghyeon
* @copyright Hansanghyeon <[email protected]>
**/
function kill_theme_wpse_188906($themes)
@Hansanghyeon
Hansanghyeon / gist:fe6cbb8bf78aa4b1ca2bedf039ff5ea2
Last active December 30, 2020 08:58
[ui] increment icon, decrement icon
button::after {
content: "";
position: absolute;
opacity: 1;
top: 0;
left: 0;
bottom: 0;
right: 0;
transition: inherit;
background-position: center;
@Hansanghyeon
Hansanghyeon / iosCheckbox.scss
Created December 30, 2020 08:52
[ui] ios checkbox
label.iosCheckbox {
display: inline-block;
background: #fff;
padding: 10px 15px;
> input {
display: none;
}
i {