Skip to content

Instantly share code, notes, and snippets.

View che-free's full-sized avatar

EnjoyDev che-free

  • Republic of korea
  • 14:13 (UTC +09:00)
View GitHub Profile
@che-free
che-free / deep-merge.js
Created April 29, 2024 17:13 — forked from ahtcx/deep-merge.js
Deep-Merge JavaScript objects with ES6
// ⚠ IMPORTANT: this is old and doesn't work for many different edge cases but I'll keep it as-is for any of you want it
// ⚠ IMPORTANT: you can find more robust versions in the comments or use a library implementation such as lodash's `merge`
// Merge a `source` object to a `target` recursively
const merge = (target, source) => {
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
for (const key of Object.keys(source)) {
if (source[key] instanceof Object) Object.assign(source[key], merge(target[key], source[key]))
}
@che-free
che-free / consoleGroupLog.js
Created January 12, 2024 01:45
(크롬) 콘솔 그룹 로그 출력
/**
* 콘솔 로그 출력 (그룹 로그)
*
* ex) consoleGroupLog("로그 그룹", "로그-1", "로그-2", "로그-3");
*/
function consoleGroupLog() {
try {
console.groupCollapsed(arguments[0]);
for (var i = 1; i < arguments.length; i++) {
console.log(arguments[i]);
@che-free
che-free / jekyll_page_path_list.md
Last active December 19, 2019 14:16
Jekyll에서 Pages 경로 리스트 추출

Jekyll에서 Pages 경로 리스트 추출

{%- assign array_string = "" -%}
{%- for page in site.pages -%}
    {%- assign path_only = "/" | append : page.path | remove : page.name -%}
    {%- if array_string != "" -%}
        {%- assign array_string = array_string | append : "|" -%}
    {%- endif -%}
 {%- assign array_string = array_string | append : path_only -%}