Skip to content

Instantly share code, notes, and snippets.

View ranveer5289's full-sized avatar

Ranveer Raghuwanshi ranveer5289

View GitHub Profile
@manifestinteractive
manifestinteractive / README.md
Last active July 17, 2024 10:03
LZ-based Compression Algorithm for Salesforce Commerce Cloud (SFCC)
@JumboLove
JumboLove / multiselect-server.js
Created May 6, 2021 16:36
SFCC Page Designer Multi-select
'use strict';
module.exports.init = function (editor) {
// Add in localization or server side processing here if you need it
};
@benbjurstrom
benbjurstrom / Code.gs
Last active September 10, 2024 10:16
PurgeOldEmails
/*
|--------------------------------------------------------------------------
| PurgeOldEmails
|--------------------------------------------------------------------------
| https://gist.github.com/benbjurstrom/00cdfdb24e39c59c124e812d5effa39a
|
*/
// Purge messages automatically after how many days?
var DELETE_AFTER_DAYS = 7
const serialize = uri => decodeURIComponent(uri).split('&').map(uri => ({ [uri.split('=')[0]]: uri.split('=')[1] })).reduce((a,b) => Object.assign(a,b))
console.log(serialize("_id%3D58c43d995cb9191a2f676b25%26index%3D0%26guid%3D798ebd68-22d5-4465-9d34-d4717891901d%26isActive%3Dfalse%26balance%3D%242%2C569.51%26picture%3Dhttp%3A%2F%2Fplacehold.it%2F32x32%26age%3D33%26eyeColor%3Dgreen%26name%3DDesiree%20Cervantes%26gender%3Dfemale%26company%3DSYNKGEN%26email%3Ddesireecervantes%40synkgen.com%26phone%3D%2B1%20(975)%20536-2019%26address%3D855%20Hendrickson%20Street%2C%20Libertytown%2C%20Marshall%20Islands%2C%205292%26about%3DElit%20anim%20occaecat%20proident%20consectetur%20veniam%20et%20deserunt%20irure.%20Sint%20aliquip%20fugiat%20aute%20tempor%20veniam%20eu%20duis%20mollit%20eiusmod%20aliquip%20ipsum%20enim%20do%20in.%20Pariatur%20nisi%20proident%20commodo%20duis%20nisi%20id%20ut%20commodo%20aute%20irure.%20Minim%20ut%20tempor%20in%20tempor%20dolor%20ex%20veniam%20fugiat.%20Sint%20cillum%20non%20qui%20elit%20a
@rauschma
rauschma / proxies-es5.js
Last active November 2, 2020 23:16
ES6 proxies in ES5
//----- The ECMAScript 6 meta object protocol (MOP) implemented in ES5
// This is how getting a property is handled internally.
// Double underscore (__) implies internal operation.
Object.prototype.__Get__ = function (propKey, receiver) {
receiver = receiver || this;
var desc = this.__GetOwnProperty__(propKey);
if (desc === undefined) {
var parent = this.__GetPrototypeOf__();
if (parent === null) return undefined;
@slashdotdash
slashdotdash / Gruntfile.js
Created February 19, 2014 22:15
Grunt config to with task to compile React .jsx files to .js
/*global module:false*/
module.exports = function(grunt) {
grunt.initConfig({
react: {
jsx: {
files: [
{
expand: true,
cwd: 'public/js',
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active October 12, 2024 16:34
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");