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
@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
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
const express = require('express')
const app = express()
const port = 3000
const axios = require('axios')
const bodyParser = require('body-parser')
// parse application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }))
@picsoung
picsoung / typeform_misty.js
Created August 16, 2019 23:22
Connect Typeform to Misty and make her react when someone fills up a typeform
const express = require('express')
const app = express()
const axios = require('axios')
const bodyParser = require('body-parser')
const say = require('say')
const FormData = require('form-data')
var fs = require('fs');
const WaveFile = require('wavefile');