Skip to content

Instantly share code, notes, and snippets.

Avatar
🗑️

Charlie Hess CharlieHess

🗑️
View GitHub Profile
@CharlieHess
CharlieHess / index.html
Last active Sep 30, 2019
nativeWindowOpen + Dropbox chooser
View index.html
<!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 Sep 30, 2019
nativeWindowOpen + Dropbox chooser
View index.html
<!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 Sep 17, 2019
isVisible vs isFocused
View index.html
<!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 Sep 5, 2019
Proxy BrowserWindow with allowed methods
View index.html
<!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 Jul 11, 2019
Proof of concept for making App Store Connect requests
View app-store-builds.ts
/* 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';
View stardew-valley-gifting-guide.md
Gift Your ex-roommate The townsfolk
Beer
Homecooked meals
Grass
"Grass"
Rare crystals
"Rare crystals"
@CharlieHess
CharlieHess / tally-workspace-usage.spec.js
Last active Sep 30, 2017
A test for the workspace usage epic
View tally-workspace-usage.spec.js
import { rxSandbox } from 'rx-sandbox';
import { tallyWorkspaceUsageEpic } from '../epics/tally-workspace-usage';
describe('tallyWorkspaceUsageEpic', () => {
it('should accumulate time until the app is quit', () => {
const { hot, flush, getMessages, e } = rxSandbox.create();
const w = { type: WORKSPACE.SELECTION_CHANGED, payload: 'Hiro' };
const x = { type: WORKSPACE.SELECTION_CHANGED, payload: 'Fiona' };
@CharlieHess
CharlieHess / tally-workspace-usage.js
Last active Sep 27, 2017
An Epic that tallies time spent in workspaces
View tally-workspace-usage.js
/**
* Keep a running total of time spent on each workspace and, once the app is quit,
* fire an action that updates the usage property in the store.
*/
const tallyWorkspaceUsageEpic = (action$, store, scheduler) => {
return selectionChangedObservable(action$, store)
.timeInterval(scheduler)
.pairwise()
.reduce(usagePayloadFromIntervals, {})
.map((payload) => ({
View notification-actions.js
import { webContents as WebContents } from 'electron';
import { NOTIFICATIONS } from '../constants/actions';
import {
notificationClickCode,
notificationReplyCode
} from '../constants/code';
/**
* An epic that executes some code in the guest page when the user clicks or
* replies to a native notification.
@CharlieHess
CharlieHess / sign-in-window.js
Last active Sep 28, 2017
A redux-observable epic that handles first time sign-in
View sign-in-window.js
import { BrowserWindow } from 'electron';
import { REHYDRATE } from 'redux-persist/constants';
import { getWorkspacesCount } from '../reducers/workspaces';
const signInWindowEpic = (action$, store) => {
// Rehydrate is just a $10 word for "we loaded saved state from a file"
// Since we're a redux-persist app, it's one of the first actions that occurs
return action$.ofType(REHYDRATE)
.filter(() => getWorkspacesCount(store) > 0)
.map(() => createSignInWindow(store))