Skip to content

Instantly share code, notes, and snippets.

View ValentinH's full-sized avatar

Valentin Hervieu ValentinH

View GitHub Profile
@ValentinH
ValentinH / examples.test.ts
Last active March 11, 2023 21:59
mockGQLResolver is a wrapper around MSW to mock any GQL operations
import { mockGQLResolver } from './mockGQLResolver';
describe('mockGQLResolver demo', () => {
it('mocking a query with a plain object', async () => {
mockGQLResolver({
queries: {
ExampleQueryName: {
users: [
{ id: '1', name: 'John' },
{ id: '2', name: 'Jane' },
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
browse('https://meet.new')
let count = 1
let tab = ''
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
async function sleep(time = 1000) {
return new Promise(resolve => setTimeout(resolve, time))
}
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
async function sleep(time = 1000) {
return new Promise(resolve => setTimeout(resolve, time))
}
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
async function sleep(time = 1000) {
return new Promise(resolve => setTimeout(resolve, time))
}
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
async function sleep(time = 1000) {
return new Promise(resolve => setTimeout(resolve, time))
}
// Menu: Meet
// Description: Start new meet and paste on Slack
// Author: Valentin Hervieu
// Twitter: @ValentinHervieu
import "@johnlindquist/kit"
async function sleep(time = 1000) {
return new Promise(resolve => setTimeout(resolve, time))
}
@ValentinH
ValentinH / named import VSCode snippet
Created January 2, 2021 13:54
VSCode snippet for named-import snippet
{
"Named import": {
"prefix": "ni",
"body": [
"import {$2} from '$1'"
],
"description": "Named import"
}
}
function decryptBigIpCookie(cookieValue) {
const [ipPart, portPart] = cookieValue.split('.')
const hexIp = parseInt(ipPart, 10)
.toString(16)
.padStart(8, '0')
const ip1 = parseInt(hexIp.toString().substring(6, 8), 16)
const ip2 = parseInt(hexIp.toString().substring(4, 6), 16)
const ip3 = parseInt(hexIp.toString().substring(2, 4), 16)
const ip4 = parseInt(hexIp.toString().substring(0, 2), 16)
@ValentinH
ValentinH / Stylefile.yml
Created August 3, 2018 18:06
Customizations for www.ricardo.ch via StyleURL.
---
version: 1.0
domains:
- www.ricardo.ch
url_patterns:
- www.ricardo.ch/*
timestamp: '2018-08-03T18:06:21Z'
id: vts2
redirect_url: https://www.ricardo.ch/fr/a/schoene-ohrstecker-1001262266/
shared_via: StyleURL - (https://www.styleurl.app) import and export CSS changes from