Skip to content

Instantly share code, notes, and snippets.

View achepukov's full-sized avatar
🎯
Focusing

Alexander achepukov

🎯
Focusing
View GitHub Profile
@netsi1964
netsi1964 / CopyToClipboard.jsx
Last active March 17, 2025 15:22
ReactJS component: Copy to clipboard
class CopyToClipboard extends React.Component {
copy() {
const textarea = this.textarea;
let { text, onCopy, silent } = this.props;
silent =
typeof silent === "boolean" ||
silent.toLowerCase() == "true" ||
silent == "1";
textarea.value = onCopy.call(this, text);
textarea.select();
@Yimiprod
Yimiprod / difference.js
Last active May 4, 2025 11:59
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {