Skip to content

Instantly share code, notes, and snippets.

View vishnuixm's full-sized avatar
😀

Vishnu Prasad vishnuixm

😀
View GitHub Profile
@vishnuixm
vishnuixm / gist:a547c4990310d83de42ed96442ffa1b7
Last active January 9, 2024 11:57
Shopify CustomerLabs profile unification

Add if cart token is coming on webhook

attaching shopify_cart_token as external id

browser.cookie.get('cart').then(function(cart_token){
    fetch("//io.v2.customerlabs.co/externalIds?shopify_cart_token=" + cart_token + "&id=" + window.CLabsgbVar.appId + "&uid=" + window.CLabsgbVar.generalProps.uid);
}).catch(function(e){
   console.log("clabs cart token collection issue", e)
});
@vishnuixm
vishnuixm / spacemacs.sh
Created July 4, 2017 02:20 — forked from shaybix/spacemacs.sh
Install Emacs and Spacemacs on Ubuntu
sudo apt-get install -y build-essential wget gcc g++ texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev
#Download Emacs 24.5+ source code
wget ftp://ftp.gnu.org/pub/gnu/emacs/emacs-24.5.tar.gz
tar -zxvf emacs-24.5.tar.gz
cd emacs-24.5
./configure
@vishnuixm
vishnuixm / express-jwt.js
Created August 16, 2016 06:41 — forked from vesse/express-jwt.js
Two Passport + JWT (JSON Web Token) examples
//
// Implementation using express-jwt middle
//
var express = require('express'),
ejwt = require('express-jwt'),
jwt = require('jsonwebtoken'),
passport = require('passport'),
bodyParser = require('body-parser'),
LocalStrategy = require('passport-local').Strategy,
BearerStrategy = require('passport-http-bearer').Strategy;
@vishnuixm
vishnuixm / using_mailboxes_in_elm.md
Created March 10, 2016 06:40 — forked from mgold/using_mailboxes_in_elm.md
Using Mailboxes in Elm: a tutorial blog post

Using Mailboxes in Elm

Max Goldstein | July 30, 2015 | Elm 0.15.1

In Elm, signals always have a data source associated with them. Window.dimensions is exactly what you think it is, and you can't send your own events on it. You can derive your own signals from these primitives using map, filter, and merge, but the timing of events is beyond your control.

This becomes a problem when you try to add UI elements. We want to be able to add checkboxes and dropdown menus, and to receive the current state of these elements as a signal. So how do we do that?

The Bad Old Days