Skip to content

Instantly share code, notes, and snippets.

@iffy
iffy / package.json
Created June 12, 2017 20:20
Cannot find module '../package' from 'node-pre-gyp.js'
{
"dependencies": {
"jest": "20.0.4",
"sqlite3": "3.1.8"
}
}
@iffy
iffy / .gitignore
Last active April 17, 2024 07:19
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
// $ cat node_modules/electron-builder-http/out/httpExecutor.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.HttpExecutor = exports.HttpError = exports.executorHolder = exports.HttpExecutorHolder = undefined;
exports.download = download;
exports.request = request;
exports.configureRequestOptions = configureRequestOptions;
@iffy
iffy / logs.txt
Created February 3, 2017 18:37
Log of running electron-updater-example
[2017-02-03 11:34:17:0977] [info] App starting...
[2017-02-03 11:34:18:0999] [info] Checking for update
[2017-02-03 11:34:19:0000] [info] Checking for update...
[2017-02-03 11:34:19:0929] [warn] Error: Could not get code signature for running application
at Error (native)
at MacUpdater.onUpdateAvailable (/Applications/electron-updater-example.app/Contents/Resources/app.asar/node_modules/electron-updater/src/MacUpdater.ts:28:24)
at /Applications/electron-updater-example.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:182:10
at next (<anonymous>)
at undefined.tryCatcher (/Applications/electron-updater-example.app/Contents/Resources/app.asar/node_modules/bluebird/js/release/util.js:16:23)
at PromiseSpawn._promiseFulfilled (/Applications/electron-updater-example.app/Contents/Resources/app.asar/node_modules/bluebird/js/release/generators.js:97:49)
@iffy
iffy / main.js
Created February 3, 2017 17:15
A complete example showing how to have an auto-updating Electron app using `electron-updater`
// main.js
@iffy
iffy / myloader.js
Created November 14, 2016 19:50
Poor man's yepnope
function MinimalPromise() {
this.callbacks = [];
this.then = function(cb) {
this.callbacks.push(cb);
if (this.result !== undefined && !(this.result instanceof MinimalPromise)) {
this._pump();
}
return this;
}.bind(this);
import time
from uuid import uuid4
from twisted.internet import threads
from crochet import run_in_reactor, setup
setup()
import structlog
logger = structlog.get_logger()
@iffy
iffy / finisher.py
Created August 18, 2016 20:01
Am I not using notifyFinish right?
from twisted.internet import defer
from klein import Klein
class App(object):
app = Klein()
@app.route('/')
def index(self, request):
def finished(x):

Keybase proof

I hereby claim:

  • I am iffy on github.
  • I am iffy (https://keybase.io/iffy) on keybase.
  • I have a public key whose fingerprint is AD57 3DA0 C4BB 0638 AD17 7C7B DB43 B7FA AB6C 49C9

To claim this, I am signing this object:

@iffy
iffy / humancrypt.md
Created June 3, 2016 17:14
The interface I'm hoping for when I do cryptographic stuff

Cryptography for Humans

Create a private key:

>>> from humancrypto import PrivateKey
>>> key = PrivateKey()
>>> with open('private.key', 'wb') as fh:
...     fh.write(key.serialize())