Skip to content

Instantly share code, notes, and snippets.

👀
overlooking issues

Guilherme Ventura danguilherme

👀
overlooking issues
Block or report user

Report or block danguilherme

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danguilherme
danguilherme / index.html
Last active Jan 18, 2019
Electron Fiddle Gist - test menu shortcuts/accelerators
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<!-- All of the Node.js APIs are available in this renderer process. -->
<pre>
<b>Node.js :</b> <script>document.write(process.versions.node)</script>
@danguilherme
danguilherme / imperative.ts
Created May 21, 2019
Imperative vs Declarative
View imperative.ts
function waitSingleWidgetInVirtualTree(
options: MacroApiOptions,
scope: ScopeItem[] = [],
callback: (
(error: Error | null, virtualTreeNode: VirtualTreeNode | null) => void
)
) {
let unsubscribeFromStore: (() => void) | null = null;
function stopWaitingSingleWidgetInVirtualTree() {
if (unsubscribeFromStore) {
@danguilherme
danguilherme / _example.ts
Created Aug 5, 2019
Send messages from Electron Renderer to Main processes, with an RxJS observable to communicate progress and completion
View _example.ts
// In Renderer
export function makeHttpRequest(url: string; method: string) {
return createIpcSender<{ url: string; method: string }, void>(
'http-request',
{ url, method },
);
}
// ... in browser window code ...
makeHttpRequest('https://httpbin.org', 'GET').subscribe({
You can’t perform that action at this time.