Skip to content

Instantly share code, notes, and snippets.

@felixrieseberg
felixrieseberg / images.js
Created May 28, 2024 22:08
Instant Image Loading
// Empty
module.exports = {
images: [
`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADCCAYAAADzRP8zAAAMQGlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAghICb0JIlICSAmhBZDebYQkQCgxBoKKHVlUcC2oWMCGrooodpodsbMo9r5YUFDWxYJdeZMCuu4r35vvmzv//efMf86cO3PvHQDUT3DF4hxUA4BcUb4kJtifkZScwiB1AwLQAVTgASy5vDwxKyoqHMAy2P69vLsBEFl71UGm9c/+/1o0+YI8HgBIFMRp/DxeLsQHAcCreGJJPgBEGW8+NV8sw7ACbQkMEOKFMpyhwFUynKbAe+U2cTFsiFsBUKFyuZIMANQuQ55RwMuAGmp9EDuJ+EIRAOoMiH1ycyfzIU6F2AbaiCGW6TPTftDJ+Jtm2pAml5sxhBVzkReVAGGeOIc7/f9Mx/8uuTnSQR9WsFIzJSExsjnDvN3Knhwmw1SIe0VpEZEQa0H8QciX20OMUjKlIfEKe9SQl8eGOQO6EDvxuQFhEBtCHCTKiQhX8mnpwiAOxHCFoNOE+Zw4iPUgXijIC4xV2mySTI5R+kLr0yVslpI/x5XI/cp8PZBmx7OU+q8zBRylPqZWmBmXCDEFYosCYUIExGoQO+Zlx4YpbcYUZrIjBm0k0hhZ/BYQxwhEwf4KfawgXRIUo7Qvzc0bnC+2KVPIiVDi/fmZcSGK/GCtPK48fjgX7LJAxIof1BHkJYUPzoUvCAhUzB3rFojiY5U6H8T5/jGKsThFnBOltMfNBDnBMt4MYpe8gljlWDwhHy5IhT6eLs6PilPEiRdmcUOjFPHgy0A4YIMAwABSWNPAZJAFhO29Db3wTtETBLhAAjKAADgomcERifIeEbzGgkLwJ0QCkDc0zl/eKwAFkP86xCquDiBd3lsgH5ENnkKcC8JADryXykeJhrwlgCeQEf7DOxd
@felixrieseberg
felixrieseberg / index.html
Created May 21, 2024 15:50
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<title>Programmatic Drag Event</title>
<style>
#drag-source {
width: 200px;
height: 200px;
background-color: lightgreen;
margin-bottom: 20px;
@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 / 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 / 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 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>
@felixrieseberg
felixrieseberg / Slack's Electron Versions
Last active May 30, 2024 21:59
Tags, Electron versions, Chromium versions
{
"master": {
"electron": "31.0.0-beta.7",
"chromium": "126.0.6445.0",
"date": "2024-05-30"
},
"4.39.81": {
"electron": "31.0.0-beta.5",
"chromium": "126.0.6445.0",
"date": "2024-05-29"
@felixrieseberg
felixrieseberg / index.html
Created February 18, 2021 19:58
Simple Menu Fiddle
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
@felixrieseberg
felixrieseberg / index.html
Created February 1, 2021 22:01
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>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->