Skip to content

Instantly share code, notes, and snippets.

@felixrieseberg
felixrieseberg / Slack's Electron Versions
Last active April 18, 2024 21:37
Tags, Electron versions, Chromium versions
{
"master": {
"electron": "30.0.0-beta.8",
"chromium": "124.0.6367.29",
"date": "2024-04-18"
},
"4.38.115": {
"electron": "30.0.0",
"chromium": "124.0.6367.49",
"date": "2024-04-17"
@felixrieseberg
felixrieseberg / index.html
Created April 10, 2024 23:19
Electron Fiddle Gist
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Color Change Boxes</title>
<style>
body, html {
margin: 0;
padding: 0;
@felixrieseberg
felixrieseberg / index.html
Created September 25, 2018 01:03
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>BrowserView Demo</title>
</head>
<body>
<h1>BrowserView Demo</h1>
<button>Toggle BrowserView</button>
@felixrieseberg
felixrieseberg / main.js
Created January 17, 2024 18:09
Electron Fiddle Gist
// Modules to control application life and create native browser window
const { app, BrowserWindow } = require('electron')
const childProcess = require('child_process')
async function createWindow () {
childProcess.execSync('osascript -e \'tell application "Finder" to activate\'');
// Create new window
w = new BrowserWindow({
type: 'panel',
@felixrieseberg
felixrieseberg / index.html
Created August 22, 2018 03:09
Electron Fiddle Gist
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hi</title>
</head>
<body>
<video></video>
<script>
require('./renderer.js')
</script>
@felixrieseberg
felixrieseberg / weather.js
Created April 19, 2022 20:39
Hi Stripe friends!
const url = new URL('https://api.tidesandcurrents.noaa.gov/api/prod/datagetter');
url.search = new URLSearchParams({
station: '9414290',
product: 'water_temperature',
time_zone: 'lst',
units: 'english',
date: 'today',
application: 'GGTC',
format: 'json'
}).toString();
@felixrieseberg
felixrieseberg / get_channels.js
Last active March 25, 2022 00:59
Slack: Get a list of your channels (excluding DMs, group chats, and archived/private channels)
// Open up the Slack Developer Tools by entering "/slackdevtools"
// in the message input.
// First, run this. The client will reload.
slackDebug.enable()
// Then, get channels. See "filterChannels" to remove channels
// beginning with a certain prefix.
(function getMyChannels() {
const allChannels = slackDebug.storeInstance.getStateByTeamId(slackDebug.activeTeamId).channels.__proto__
@felixrieseberg
felixrieseberg / index.html
Created August 5, 2020 00:08
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<script>
// You can also require other files to run in this process
@felixrieseberg
felixrieseberg / index.html
Created August 9, 2018 20:52
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
@felixrieseberg
felixrieseberg / index.html
Created July 14, 2021 20:38
Stripe, iframe, and CSP
<!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 https://js.stripe.com 'self'; connect-src https://api.stripe.com; frame-src https://js.stripe.com https://hooks.stripe.com">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src https://js.stripe.com 'self'; connect-src https://api.stripe.com; frame-src https://js.stripe.com https://hooks.stripe.com">
<title>Hello World!</title>
<script src="https://js.stripe.com/v3" async></script>
</head>