This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Path from 'path' | |
import express from 'express' | |
import Router from 'express-promise-router' | |
import { createProxyMiddleware } from 'http-proxy-middleware' | |
import env from '../env.js' | |
let assetsRoutes, indexHtmlFallback | |
// proxy requests to `parcel serve` process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react' | |
import { createBrowserRouter, RouterProvider, Navigate, useLocation } from 'react-router-dom' | |
import { getLoginUrl } from '~/client/lib/urls' | |
import { useCurrentUser } from '~/client/hooks/auth' | |
import AppError from '~/client/components/AppError' | |
import FullPageLoading from './components/FullPageLoading' | |
import routeFiles from './routes/**/{Error,NotFound,Layout,Page}.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make new album and go to the add images page then run this script in the console | |
stopIt = false | |
;(async () => { | |
const scrollParent = $('.Purf9b') | |
const wait = async ms => { | |
await new Promise((r, rj) => { | |
setTimeout(() => { r() }, ms) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkey Patch Knapsack to merge reports instead of overwrite | |
begin | |
class Knapsack::Report | |
alias_method :save_without_leading_existing_report, :save | |
def save | |
Knapsack::Presenter.existing_report = open | |
save_without_leading_existing_report | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useState } from 'react' | |
import PropTypes from 'prop-types' | |
import ReactCrop from 'react-image-crop' | |
import 'react-image-crop/dist/ReactCrop.css' | |
export default function CropImage({ | |
className = '', | |
src, | |
height, | |
width, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hyperspace-simulator tail_hypercore.js -- 0ce9e824c768daf0564f6f1ec24e04430111b8845476464ffbf60e8e3ef06347 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var postMessageRoundTripCounter = 0; | |
var setTimeoutRoundTripCounter = 0; | |
startPostMessageLoop = function(){ | |
// var lastPostMessageAt = Date.now() | |
var receiveMessage = function(message){ | |
if (message.data !== 'postMessageTest') return; | |
// var delta = Date.now() - lastPostMessageAt; | |
// console.log('postMessage delta:', delta); | |
postMessageRoundTripCounter++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is an example of how one could track if going back or forward is | |
an option for the user. | |
*/ | |
if (!window.history.state || !window.history.state.visitedAt){ | |
window.history.replaceState( | |
{...history.state, visitedAt: Date.now()}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
launchctl unload ~/Library/LaunchAgents/com.epicgames.launcher.plist | |
rm ~/Library/LaunchAgents/com.epicgames.launcher.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h, Fragment } from 'preact' | |
import { memo } from 'preact/compat' | |
import PropTypes from 'prop-types' | |
import Link from 'components/Link' | |
const RawHTML = memo(({source = '', ignoreNodes = []}) => { | |
const parser = new global.DOMParser() | |
const doc = parser.parseFromString(source, "text/html") | |
const options = { |
NewerOlder