Skip to content

Instantly share code, notes, and snippets.

@ayal
ayal / spotify.md
Created October 22, 2021 14:28
velo spotify integration markdown

Spotify Integration

Setup

Configuration

1 - spotify_client_secret stored in Velo secret manager value should be the Client Secret generated after registering your application

@ayal
ayal / presence.md
Last active October 22, 2021 14:32
velo presence package readme

Site Members Presence

Use this package to add a widget showing the site members that are currently on your site.

Setup

Add a repeater with id onlineUsers inside the repeater you can set: image with id profilePic text with id userName How to Use the Package in your Site In your home page paste the following code:

@ayal
ayal / test.ts
Last active January 17, 2022 09:44
image loaded hook
Object.defineProperty(Image.prototype, 'onload', {
set: function (fn) {
fn();
},
configurable: true,
});
@ayal
ayal / date_match.js
Last active February 2, 2022 19:46
hebrew date match
import { HDate } from '@hebcal/core';
const month = 1; // feb, zero based (so 0=jan, 1=feb etc..)
const day = 2;
const time = 13;
const year = 1984;
for (let i = 0; i < 120; i++) {
const loazi_date = new Date(year+i, month, day, time) // 02/02/198X 13:00
const hebrew_date = new HDate(loazi_date);
@ayal
ayal / server.js
Created March 5, 2023 08:03
simple node server with cors allow all
const http = require('http');
const hostname = '127.0.0.1';
const port = 3300;
const server = http.createServer((req, res) => {
console.log('got request', req.method);
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', '*');
res.setHeader('Access-Control-Allow-Headers', '*');
@ayal
ayal / updateproduct__schema.js
Last active July 31, 2023 18:35
update product schema
export const updateProduct__schema = {
name: 'updateProduct',
description: 'Updates specified fields in a product.',
parameters: {
type: 'object',
properties: {
_id: {
type: 'string',
},
product: {