Skip to content

Instantly share code, notes, and snippets.

@nidefawl
nidefawl / pw-easylink
Last active November 12, 2024 05:30 — forked from fxthomas/pw-easylink
Small tool to configure and maintain PipeWire links between sets of input/output port querie
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@mrbarletta
mrbarletta / MailgunWebhooks.php
Last active December 24, 2018 15:26
MailgunWebhooks Entrypoint - sets SuiteCRM email opted out + Note with details for reference
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
function unsubscribeNote($recipient, $note, $description)
{
global $db;
$queryOptout = "UPDATE email_addresses SET opt_out=1 WHERE email_address='?'";
$queryBeans = "SELECT emr.bean_id, emr.bean_module FROM email_addresses ema
INNER JOIN email_addr_bean_rel emr ON ema.id=emr.email_address_id
@mrbarletta
mrbarletta / gravity_forms_webhook_example_suitecrm.php
Last active March 21, 2021 04:08
Gravity Forms Webhook example - Posting data to SuiteCRM/SugarCRM/LionixCRM - working example
<?php
// Add the following code to your theme functions.php (not recommended as might get lost on updates) or create a plugin
//LX - CRM
add_action( 'gform_after_submission', 'post_to_crm', 10, 2 );
function post_to_crm( $entry, $form ) {
$post_url = 'https://youInstance.lionix.com/index.php?entryPoint=WebToPersonCapture';
$post=false;
//Gravity forms has IDs for each of the fields . Some fields, like 1.3, means FIELD 1, subfield 3. Which usually means first_name
@atinux
atinux / async-foreach.js
Last active April 2, 2025 11:34
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@pisculichi
pisculichi / radios_nacionales.txt
Last active November 9, 2025 19:16
URLs de radios nacionales de Argentina, para poder escuchar en la terminal con mplayer o vlc
# alias radio='function __radio(){ r=`grep -v "#" radios_nacionales.txt | grep -m 1 -i $1 | cut -d" " -f1`; cvlc $r 2> /dev/null; }; __radio'
# podria utilizarse mplayer en vez de vlc
AMs Nacionales
http://cdn.instream.audio:9288/stream Radio Madre 530
https://streaming1.hostingmontevideo.com:7019/; Radio Colonia 550
http://server.laradio.online:25224/live.mp3 Radio Argentina 570
http://playerservices.streamtheworld.com/api/livestream-redirect/CONTINENTAL_SC Continental 590
https://streammax.alsolnet.com/radiorivadavia Rivadavia 630