Skip to content

Instantly share code, notes, and snippets.

View picsoung's full-sized avatar
🧀
🇫🇷 🐸 Hacking around 🤓👨‍💻

Nicolas Grenié picsoung

🧀
🇫🇷 🐸 Hacking around 🤓👨‍💻
View GitHub Profile
We are building an application called Garple.com for selling domain names.
The landing page displays a list of all domain names, including ones that were already purchased.
Clicking on them leads to a payment form where the domain can be purchased with a credit card.
Each domain has a name and tier, as well as buyerEmail, and the columns necessary for buying it.
Don't add any other columns. Tier should be a number between 1 and 4.
There is no need for customers to register.
Prices should be rendered like "$1,800" with no decimals and no "usd".
Make sure to include all links as anchor tags.
The application will be accessible under any of the domains we're selling, and opening that domain will show the domain details page.
@picsoung
picsoung / airtable_sync_typeform.js
Created April 16, 2024 10:15
Airtable scripting to synchronize values from Airtable to Typeform dropdown
const TYPEFORM_API_KEY = "REPLACE_WITHYOURKEY"
const TYPEFORM_API_URL = "https://api.typeform.com"
const TYPEFORM_FORM_ID = "REPLACE_WITH_FORM_ID"
const TYPEFORM_FIELD_REF = "REPLACE_WITH_FIELD_REF"
let table = base.getTable('Teams');
// Query the table to retrieve records
let query = await table.selectRecordsAsync();
@picsoung
picsoung / extract_and_transform.js
Created April 16, 2024 08:05
Code snippet to extract answers from typeform webhook payload
const extractValue = (tfAnswer) => {
switch (tfAnswer.type) {
case "choices":
if (tfAnswer.choices) {
// Multiple choices
let labels = tfAnswer.choices.labels || [];
if (tfAnswer.choices.other) {
labels.push(tfAnswer.choices.other);
}
return labels; // Return an array of selected labels
Nordic Growth Summit Frequently Asked Questions
What is Nordic Growth Summit?
This is a one-day learning event that brings international speakers to a Nordic stage, right here in Oslo.
The audience is CEOs and other C-Suite roles at Nordic businesses ready for growth.
The themes for 2024 are HubSpot, AI and growing your business.
Who attends the event?
The event is attended by CEOs, other C-Suite professionals and business leaders who are based in the Nordic region.
unsigned fun(unsigned n)
{
if (n == 0) return 1;
if (n == 1) return 2;
return fun(n-1) + fun(n-1);
}
@picsoung
picsoung / django_webhook_typeform.py
Created May 3, 2022 18:13
Typeform Django webhook
import hashlib
import hmac
import json
import base64
import os
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseServerError
from django.views.decorators.csrf import csrf_exempt
from fastapi import FastAPI,Request,HTTPException
import hashlib
import hmac
import json
import base64
import os
app = FastAPI()
import {
IExecuteFunctions,
} from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
@picsoung
picsoung / zapier.js
Created August 19, 2021 22:11
Generate a list of X upcoming days in the future.
let {current_day, EXCLUDE_WEEKENDS,INTERVAL} = inputData
let dates = []
let j = 1;
do{
let d = new Date(current_day);
d.setDate(d.getDate()+j)
if(EXCLUDE_WEEKENDS==="true"){//exclude weekends
if(d.getDay() === 6){ //saturday
d.setDate(d.getDate() + 2);
@picsoung
picsoung / typeform-list-pays.txt
Created December 9, 2020 16:23
Une liste à copier/coller pour Typeform - liste sous license Creative Commons https://sql.sh/514-liste-pays-csv-xml
Afghanistan
Afrique du Sud
Albanie
Algérie
Allemagne
Andorre
Angola
Anguilla
Antarctique
Antigua-et-Barbuda