Skip to content

Instantly share code, notes, and snippets.

View CharlieHess's full-sized avatar
🗑️

Charlie Hess CharlieHess

🗑️
View GitHub Profile
@CharlieHess
CharlieHess / how-to-use-it.tsx
Last active August 27, 2020 13:45
Helpers to track OutlinePass selection
function Scene() {
return (
<Canvas>
<OutlineItemsProvider>
<SomeMesh />
<SomeMesh />
<SomeMesh />
<Effects />
</OutlineItemsProvider>
</Canvas>
@CharlieHess
CharlieHess / prompt-to-update-epic.ts
Last active November 6, 2019 20:38
Example of prompting users when an update is available
/**
* Shows a notification prompting users to restart when an update has been downloaded
* and we're ready to apply it.
*/
export const promptToUpdateEpic: Epic<Action<ReleaseChannel | UpdateStatus>, State> = (
action$,
store,
) => {
// Update status is redux state populated by autoUpdater events
const updateStatusChanged = action$.pipe(
@CharlieHess
CharlieHess / main.js
Created October 30, 2019 18:11
web-contents-created fired too early?
const {app, BrowserWindow, webContents: WebContents} = require('electron')
const assert = require('assert')
let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
@CharlieHess
CharlieHess / index.html
Created October 4, 2019 20:27
Electron Fiddle Gist
<!-- Empty -->
@CharlieHess
CharlieHess / index.html
Created October 4, 2019 14:56
Electron Fiddle Gist
<!-- Empty -->
@CharlieHess
CharlieHess / index.html
Last active September 30, 2019 19:51
nativeWindowOpen + Dropbox chooser
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
@CharlieHess
CharlieHess / index.html
Created September 30, 2019 19:41
nativeWindowOpen + Dropbox chooser
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
@CharlieHess
CharlieHess / index.html
Last active September 17, 2019 20:34
isVisible vs isFocused
<!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>,
@CharlieHess
CharlieHess / index.html
Created September 5, 2019 15:24
Proxy BrowserWindow with allowed methods
<!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>,
@CharlieHess
CharlieHess / app-store-builds.ts
Created July 11, 2019 00:39
Proof of concept for making App Store Connect requests
/* tslint:disable: no-console */
import * as fs from 'fs-extra';
import { sign } from 'jsonwebtoken';
import { memoize, take } from 'lodash';
import fetch from 'node-fetch';
import * as path from 'path';
const KEY_ID = 'XXXXSECRET';
const ISSUER_ID = 'secret-xxxx-xxxx-xxxx-secret';