Skip to content

Instantly share code, notes, and snippets.

View shanwixcode's full-sized avatar
🏠
Working from home

Shan shanwixcode

🏠
Working from home
View GitHub Profile
@shanwixcode
shanwixcode / subLb.rb
Last active June 28, 2020 05:34
Stripe Tutorial - Dude Lemon
export function selectPlan_click(event) {
let $item = $w.at(event.context);
$w('#selectPlan').hide(); //hide button
$item("#openingLb").show(); //show a loader animation on this item
let planData = $item("#plans").getCurrentItem(); //get the click item's data from its dataset
let deployData = {
name: planData.displayName,
price: planData.displayPrice,
planId: planData.planId,
currency: planData.currency
@shanwixcode
shanwixcode / Google & Outlook Calendar Event
Created August 31, 2019 16:20
Save The Date For Google & Outlook Calendar
//Google Calendar Event
https://calendar.google.com/calendar/r/eventedit?text=The+Event+Name&dates=20191005T100000/20191005T220000&details=The+event's+day+session+is+from+10+AM+to+3+PM.+The+event's+evening+session+is+from+5+PM+to+10+PM.&location=The+Rooftop+at+Pier+17+89+South+Street+NY,+NY+10038+USA&ctz=America/New_York
//Outlook Calendar Event
https://outlook.live.com/owa/?path=/calendar/action/compose&rru=addevent&startdt=20191005T043000&enddt=20191005T163000&subject=The+Event+Name&body=The+event's+day+session+is+from+10+AM+to+3+PM.+The+event's+evening+session+is+from+5+PM+to+10+PM.&location=The+Rooftop+at+Pier+17+89+South+Street+NY,+NY+10038+USA
@shanwixcode
shanwixcode / Corvid & Wix Gallery
Last active August 22, 2019 16:21
Code to load data into Wix Gallery using a Dataset
@shanwixcode
shanwixcode / insert.js
Last active June 28, 2020 06:08
Wix Code - Google Calendar API Page Code
import {insertNewEvent} from 'backend/createEvent.jsw';
$w.onReady(function () {
});
var startdateNumber;
var startmonth;
var startyear;
var starttime;
@shanwixcode
shanwixcode / gcp.js
Last active June 28, 2020 06:07
Wix Code - Google Calendar API Backend File 2
import wixData from 'wix-data';
const {google} = require("googleapis");
let options = {
"suppressAuth": true //suppress db auth to allow secure db permissions
};
export async function insertNewEvent(summary, location, description, start, end, attendees) {
const authorizedAuthClient = await createAuthorizedClient();
return insertRow(authorizedAuthClient, summary, location, description, start, end, attendees);
@shanwixcode
shanwixcode / gcpBackend.js
Last active June 28, 2020 06:06
Wix Code - Google Calendar API Backend File config
import wixData from 'wix-data';
const {google} = require("googleapis");
const SCOPES = ['https://www.googleapis.com/auth/calendar']; //the url of the api
let options = {
"suppressAuth": true //suppress db auth to allow secure db permissions
};
//-----------------------------Insert Client Config File Into Database----------------------------//
@shanwixcode
shanwixcode / gcpCalendarPage.js
Last active June 28, 2020 06:05
Wix Code - Web App For Google Calendar API
import {client, getAuthUrl, generateTokens} from 'backend/config.jsw';
export function clientConfig_keyPress(event) {
if (event.key === "Enter") {
let str = $w('#clientConfig').value;
if (str.length === 0)
return;
client(str).then(item => {
$w('#configUploaded').show();