Skip to content

Instantly share code, notes, and snippets.

View ernestoruiz89's full-sized avatar
🎯
Focusing

Ernesto Ruiz ernestoruiz89

🎯
Focusing
View GitHub Profile
@barredterra
barredterra / dialog_promise.js
Last active March 3, 2023 19:39
Comfortably work with dialogs in Frappe Framework
function dialog_promise (title, fields, primary_action_label) {
// Return a function that returns a promise
// The promise resolves when the dialog is submitted and rejects when the dialog is closed
// On resolve, the promise returns the values from the dialog.
return () => new Promise((resolve, reject) => {
const dialog = new frappe.ui.Dialog({
title: title,
fields: fields,
onhide: () => reject(),
primary_action_label: primary_action_label,
@paulomcnally
paulomcnally / hashtag.js
Created October 17, 2012 20:54
hashtag
var WebSocket = require("socket.io").listen( 6969 );
WebSocket.sockets.on("connection", ws_start);
function ws_start(data)
{
data.on("new_message", ws_sendData);
}
function ws_sendData(data)