Skip to content

Instantly share code, notes, and snippets.

View timfish's full-sized avatar

Tim Fish timfish

  • Freelance
  • 07:17 (UTC +02:00)
View GitHub Profile
@timfish
timfish / index.html
Last active November 3, 2021 00:29
Protocol JSON stream to renderer
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@timfish
timfish / index.html
Last active July 20, 2021 20:14
no-unhandledRejection
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
@timfish
timfish / README.md
Last active January 30, 2024 18:43
Sentry Cloudflare Workers Proxy - Makes JavaScript and event submission first-party!
  • Add the worker.js code to a new Cloudflare Worker
  • Set up a worker for your domain than responds to /tunnel/* and point it to your new worker
  • Add the Sentry script to your html but replace https://browser.sentry-cdn.com/ with ./tunnel/
    • Eg. <script src="./tunnel/6.9.0/bundle.min.js"></script>
  • init Sentry with the tunnel option set to /tunnel/
    • Eg. Sentry.init({ dsn: "__DSN__", tunnel: "/tunnel/" })
  • Rejoice at how everything now works with ad blockers
{
__isElectronForgePlugin: true,
async init() {
//
},
getHook(hookName) {
switch (hookName) {
case "resolveForgeConfig":
return this.resolveForgeConfig;
}
use rhai::{plugin::*, Engine, FnPtr};
use std::{
sync::{Arc, Mutex},
thread,
time::Duration,
};
#[derive(Debug, Clone)]
pub struct Service {
func: Arc<Mutex<Option<FnPtr>>>,
@timfish
timfish / index.html
Created November 15, 2020 23:19
ip-address
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber gist uses dumber bundler, the default bundle file
@timfish
timfish / index.html
Created April 29, 2020 15:02
autonumeric
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dumber Gist</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<base href="/">
</head>
<!--
Dumber gist uses dumber bundler, the default bundle file
@timfish
timfish / app.html
Last active August 1, 2018 12:18
remove svg wrappers
<template>
<require from="./select-component"></require>
<select-component selected.bind="selected"></select-component>
<div>
Selected: ${selected.name}
</div>
</template>
@timfish
timfish / app.html
Created July 31, 2018 17:45
remove svg wrappers
<template>
<require from="./svg-rect"></require>
<svg width="100" height="100" style="background-color:lightblue">
<svg-rect rect.bind="{x: 5, y: 5, width: 30, height: 20}"></svg-rect>
</svg>
</template>
@timfish
timfish / app.html
Created July 31, 2018 17:45
remove svg wrappers
<template>
<require from="./svg-rect"></require>
<svg width="100" height="100" style="background-color:lightblue">
<svg-rect rect.bind="{x: 5, y: 5, width: 30, height: 20}"></svg-rect>
</svg>
</template>