Skip to content

Instantly share code, notes, and snippets.

View spyl94's full-sized avatar

Spyl spyl94

View GitHub Profile
@spyl94
spyl94 / verifyEdgeSignature.ts
Created December 7, 2022 20:42
Quick implementation of Qstash `verifySignature` for my own needs on vercel edge functions
import { NextRequest, NextResponse } from 'next/server';
import * as base64Url from './encoding/base64Url';
/**
* Necessary to verify the signature of a request.
*/
type ReceiverConfig = {
/**
* The current signing key. Get it from `https://console.upstash.com/qstash
*/
+------------------------+-------------------------+
| TABLE_NAME | COLUMN_NAME |
+------------------------+-------------------------+
| proposition | author_id |
| vote | author_id |
----------------------------------------------------
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use CapCollectif\IdToUuid\IdToUuidMigration;
class VersionXYZ extends IdToUuidMigration
{
public function postUp(Schema $schema)
class App extends Component {
constructor(props) {
super(props);
this.state = {
newTodo: "",
todos: [
{
id: 1,
name: "Todo 1",
dueDate: new Date()
<template>
<div id="app" class="App">
<p class="my-component">
Je suis mon premier composant
</p>
<ul>
<li v-for="todo in todos" :key="todo.id">
{{ todo.name }} - {{ todo.dueDate.toLocaleString() }}
</li>
</ul>
<div className="App">
<p className="my-component">Je suis mon premier composant</p>
<ul>
{this.state.todos.length > 0 &&
this.state.todos.map(todo => (
<li key={todo.id}>
{" "}
{todo.name} - {todo.dueDate.toLocaleString()}{" "}
</li>
))}
<template>
<div id="app" class="App">
<p class="my-component">
Je suis mon premier composant
</p>
<ul>
<li v-for="todo in todos" :key="todo.id" v-if="todos.length > 0">
{{ todo.name }} - {{ todo.dueDate.toLocaleString() }}
</li>
</ul>
<template>
<div id="app" class="App">
<p class="my-component">
Je suis mon premier composant
</p>
<ul>
<li v-for="todo in todos" :key="todo.id">
{{ todo.name }} - {{ todo.dueDate.toLocaleString() }}
</li>
</ul>
import React, { Component } from "react";
import "./App.css";
class App extends Component {
state = {
newTodo: "",
todos: [
{
id: 1,
name: "Todo 1",
<div class="before" style="background: red; position: absolute;" title="stuff" />
<div class="after" style="background: green; position: absolute;" title="stuff" />