Skip to content

Instantly share code, notes, and snippets.

@mattfysh
mattfysh / 5reqs.sh
Last active Jul 18, 2021
Luminati Performance
View 5reqs.sh
PROXY_URL=<your_proxy_url>
echo "HTTP"
time (
curl --proxy $PROXY_URL -s -o /dev/null http://example.com
curl --proxy $PROXY_URL -s -o /dev/null http://example.com
curl --proxy $PROXY_URL -s -o /dev/null http://example.com
curl --proxy $PROXY_URL -s -o /dev/null http://example.com
curl --proxy $PROXY_URL -s -o /dev/null http://example.com
)
@mattfysh
mattfysh / client.js
Last active Jul 7, 2021
urql + auth-exchange + aws-amplify
View client.js
import { makeOperation } from '@urql/svelte'
import { authExchange } from '@urql/exchange-auth'
import { Auth } from 'aws-amplify'
import produce from 'immer'
import { set } from 'lodash'
const amplifyAuthExchange = authExchange({
addAuthToOperation: ({ authState, operation }) => {
if (!authState?.token) {
return operation
View gist:89aa4dd9163c7f43375368c4dbf97669
import { onMount } from 'svelte';
function noop() { }
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
View .eslintrc.yaml
env:
node: true
es6: true
parserOptions:
ecmaVersion: 2020
sourceType: module
extends:
- airbnb-base
@mattfysh
mattfysh / main.cpp
Created Feb 1, 2020
Runtime symbols
View main.cpp
#include <iostream>
using namespace std;
template<typename T>
T make_symbol(T value, string metadata);
template<typename T>
string get_symbol_for(T value);
View utils.js
window.utils = (function() {
function touch(el, type, listener) {
if (type === 'tap') {
var isDragging, startPos;
function touchStart(e) {
el.addEventListener('touchmove', touchMove);
el.addEventListener('touchend', touchEnd);
isDragging = false;