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
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
{
"form_id": "3a1130ad-b534-4893-87e9-e9695765ec29",
"organization_id": "3c4c165b-0727-4615-960f-8b1f593915ca",
"title": "Logic VA",
"requires_contact_info": false,
"requires_contact_email": false,
"requires_contact_name": false,
"requires_contact_phone_number": false,
"requires_consent": false,
"show_contact_name": false,
@picsoung
picsoung / typeform_cloudflare_workers.js
Created November 3, 2020 03:05
Simple Cloudflare worker code to point a domain to a typeform
//Replace with yours
let TYPEFORM_URL = "https://picsoung.typeform.com/to/QXS2h1?utm_source=cf_workers"
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
let response = await fetch(TYPEFORM_URL)
{
"choices": [
{
"label": "San Francisco",
"slug": "san-francisco",
"image":"https://d13k13wj6adfdf.cloudfront.net/urban_areas/san-francisco-bay-area-7f6d130d20.jpg"
},
{
"label": "Barcelona",
"slug": "barcelona",
@picsoung
picsoung / 2014-04-09-first-day-with-apitools.md
Last active April 2, 2020 06:11
Articles posted on APItools.com blog

title: "First day with APItools (at BattleHack)" description: "This weekend I attended BattleHack hackathon in San Francisco and I thought I could give APItools a try. Here are some thoughts and feedback about using APItools in hackathon conditions." layout: blog author: Nicolas gh-author: picsoung date: 2014-04-02 categories: blog tags: hackathons CORS

cont fs = require('fs');
let wav = new WaveFile(fs.readFileSync(`hello_${username}.wav`));
let wav64 = wav.toBase64()
axios({
method: 'POST',
url: `http://${ROBOT_IP}/api/audio`,
data:{
FileName: `hello_${username}.wav`,
Data: wav64,
const { form_response } = req.body
const {answers} = form_response
let arm_field = answers.find((a) => a.field.ref === 'arm_choice')
let selected_arm = arm_field.choice.label
let username_field = answers.find((a) => a.field.ref === 'username')
let username = username_field.text