Skip to content

Instantly share code, notes, and snippets.

View KevinTss's full-sized avatar

Kevin Tassi KevinTss

  • Brussels
View GitHub Profile
import requests
import json
API_URL = "${API_URL}"
API_TOKEN = "${API_TOKEN}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {API_TOKEN}"
}
/**
* This script will
* 1. listen a webhook event for every doc creation
* 2. He will filter to keep only feedback type docs
* 3. He will then check is the source url container an hubspot deal ID
* 4. If yes, he will fetch the deal amount and add if as property on the concerned feedback
*/
import { Client } from '@hubspot/api-client';
// Assuming token is stored in Script Properties for security purposes
const token = PropertiesService.getScriptProperties().getProperty('token');
const graphqlEndpoint = 'https://api.product.cycle.app/graphql';
const MAX_RETRIES = 3;
function queryCycle(query, variables) {
let attempt = 0;
while (attempt < MAX_RETRIES) {
try {
import { Paragraph } from '@tiptap/extension-paragraph';
type DraggingParams = {
onDragStart?: VoidFunction;
onDragEnd?: VoidFunction;
nodeType: 'paragraph' | 'heading';
};
type GetNodeViewParams = {
className: string;

What happened?

During the installation of Wooclap projects and a new Prismic+Gatsby project, the npm install command line was returning the following issue due to the new Apple M1 chip:

ERR! sharp Prebuilt libvips 8.10.5 binaries are not yet available for darwin-arm64v8

Then I got an other issue while running npm start caused by react-refresh-webpack-plugin. It can be fix by running the project like this env FAST_REFRESH=false npm start or by installing a node version later than 15.3.0.

Mac usefull command line

Command line I sometime need to handle software on mac

List all running homebrew services

brew services list
git config commit.gpgsign false
# check insternet speed
# https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
console.log('codes', 'Thing to log')
console.log("\x1b[33m%s\x1b[0m" ,"I Am Using Yellow");
console.log("\x1b[44m%s\x1b[0m" ,"Background Color Is Blue");
/* It is recommended to use \x1b[0m to reset the terminal color
* else the terminal will take the last given color value.
*
* Below are the list of codes you can use to style your node console.
*/
# Create an app
heroku create app-name
# Destroy an app
heroku apps:destroy app-name
# Add heroku remote (overwrite the previous)
heroku git:remote -a app-name
# Deploy to server