Skip to content

Instantly share code, notes, and snippets.

@bitsmuggler
bitsmuggler / deep-clone.js
Last active January 16, 2023 20:36
The Best Way to Deep Clone an Object in JavaScript (See my blog post: https://www.workingsoftware.dev/how-to-deep-clone-in-javascript/)
import { strict as assert } from 'assert';
//
// Deep Clone of an object
// Blog-Post: https://www.workingsoftware.dev/how-to-deep-clone-in-javascript/
//
// Self-Made
function deepClone(obj) {
if (typeof obj !== 'object' || obj === null) {
document.getElementById('myButton').addEventListener('click', clickMe);
document.getElementById('parent').addEventListener('click', clickMe, true);
@bitsmuggler
bitsmuggler / calculator.js
Last active February 6, 2024 12:50
calculator
const calculator = {
read(a, b) {
this.a = a;
this.b = b;
},
sum() {
return this.a + this.b;
},
---
layout: post
title: "Sample Link Post"
description: "Example and code for using link posts."
tags: [sample post, link post]
comments: true
link: http://aronbordin.com
categories: [intro]
---
---
layout: post
title: "Sample Link Post"
description: "Example and code for using link posts."
tags: [sample post, link post]
comments: true
link: http://aronbordin.com
categories: [intro]
---
---
layout: post
title: "Sample Link Post"
description: "Example and code for using link posts."
tags: [sample post, link post]
comments: true
link: http://aronbordin.com
categories: [intro]
---
---
layout: dark-post
title: Dark Post
description: "Sample Dark post"
tags: [sample post]
---
This is a sample post to show the dark post theme. To use this dark theme, just add:
{% highlight yaml %}
---
layout: dark-post
title: Dark Post
description: "Sample Dark post"
tags: [sample post]
---
This is a sample post to show the dark post theme. To use this dark theme, just add:
{% highlight yaml %}
---
layout: post
title: Syntax Highlighting Post
description: "Demo post displaying the various ways of highlighting code in Markdown."
modified: 2016-12-01
tags: [sample post, code, highlighting]
categories: [intro]
---
Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.[^1]