Skip to content

Instantly share code, notes, and snippets.

View RR-Helpdesk's full-sized avatar
💭

Helpdesk RR-Helpdesk

💭
View GitHub Profile
@RR-Helpdesk
RR-Helpdesk / Deep Copy Object
Last active March 7, 2023 07:12
JS Snippets for N8N
####DEEP COPY AN OBJECT
```js
var copiedObj = JSON.parse(JSON.stringify(obj));
```
Explanation: In JavaScript objects, copying an object variable results in copying only the reference to the same object. Hence, any changes to its embedded key-pair values result in changes made to the original object variable as well.
```js
@RR-Helpdesk
RR-Helpdesk / Deep Copy and Object
Last active June 10, 2023 12:22
# # #* *JAVASCRIPT: CODE SNIPPETS** For the data geeks out there, here's a cheatsheet of JavaScript code snippets that can come in really handy for formatting data from different sources or transforming it into a usable format.
#### DEEP COPY AN OBJECT
```js
var copiedObj = JSON.parse(JSON.stringify(obj));
```
Explanation: In JavaScript objects, copying an object variable results in copying only the reference to the same object. Hence, any changes to its embedded key-pair values result in changes made to the original object variable as well.
```js
@RR-Helpdesk
RR-Helpdesk / download-website
Last active March 7, 2023 07:16
Download Website with Wget
DOWNLAOD WEBSITE USING WGET
If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the job done. RUn the following commands in terminal.
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
@RR-Helpdesk
RR-Helpdesk / Add URL for Specific Tabs
Last active October 2, 2022 14:58
Webflow CSS #webflow #css
<script>
$( function() {
function changeTab() {
var tabName = window.location.hash.substr(1);
var tabEl = $('[data-w-tab="' + tabName + '"]');
if (tabEl.length) {
tabEl.click();
}
}
@RR-Helpdesk
RR-Helpdesk / Add Files to Multiple Folders with Code.gs
Last active April 4, 2023 04:42
Google Apps Scripts #GoogleAppScript #GAS
function organizeFolders() {
// Parent Folders
var parentA = DriveApp.createFolder('Dad');
var parentB = DriveApp.createFolder('Mom');
// Child folder inside Parent Folder A
var child = parentA.createFolder('Child');
// Place Child Folder inside another Parent Folder B
parentB.addFolder(child);
@RR-Helpdesk
RR-Helpdesk / Filter Formla Examples
Last active June 10, 2023 12:09
Helpful Google Sheets Formulas #Sheets #Google
https://blog.coupler.io/filter-function-google-sheets/
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@RR-Helpdesk
RR-Helpdesk / Postgres Auth Commands
Last active June 10, 2023 12:14
Postgres SQL Statements #postgres
SHOW password_encryption;
SELECT rolpassword from pg_authid where rolname = '{your-db-user-name}';
ALTER USER "{your-db-user-name}" with password '{your-new-db-password}';
SET password_encryption = 'scram-sha-256';
SET password_encryption = 'md6';
SHOW password_encryption;
@RR-Helpdesk
RR-Helpdesk / Dynamic Copywrite Year
Last active June 10, 2023 12:12
Webflow #webflow
Add this code as an HTML embed in your footer:
<div class="paragraph">&copy; Company Name <script>document.write(new Date().getFullYear())</script>. All Rights Reserved.</div>
regexp_replace('revenue'), '[$K,1]', '') * 100