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
[
{
"id": 21310,
"title": "Subvencions per al finançament del Programa per promoure l'emprenedoria territorial especialitzada (Programa primer de preacceleració)",
"description": "L'objectiu és donar suport a les persones emprenedores mitjançant el finançament de programes de formació i tutoria que impulsin la creació i creixement d'empreses basades en la innovació, la tecnologia i els nous models de negoci.",
"categories": "Per temes|Treball|Emprenedoria",
"target_audience": "Els ajuntaments i els ens vinculats o dependents, els consells comarcals...",
"type": "Ajuts, beques i subvencions",
"application_deadline": "El termini per presentar la sol·licitud és del 26 de novembre al 5 de desembre de 2019.",
"eligibility_requirements": "En cas d'empreses amb una plantilla igual o superior a 50 persones, donar ocupació...",
@picsoung
picsoung / index.js
Created October 15, 2024 11:21
typeform webhook handler for google cloudfunction
const functions = require('@google-cloud/functions-framework');
const crypto = require('crypto');
const SECRET_TOKEN = "abc123"
functions.http('webhookHandler', (req, res) => {
// Ensure the request body is available as a string
const rawBody = req.rawBody ? req.rawBody.toString() : JSON.stringify(req.body);
const signature = req.headers['typeform-signature'];
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def index():
return 'Hello from Nico!'
@app.route('/webhook', methods=['POST'])
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()