Skip to content

Instantly share code, notes, and snippets.

View anaisbetts's full-sized avatar

Ani Betts anaisbetts

View GitHub Profile
@anaisbetts
anaisbetts / deferred-require.js
Created June 23, 2016 08:49
A failed attempt to make a lazy require
const emptyFunc = () => {};
emptyFunc.prototype = {};
// On initial call, we just return the proxy
// On next tick or >1 call, we make getters call require
// Until then getters have to create a proxy too
//
// cases:
// require('foo')();
// const {foo} = require('bar');
Activation of app microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail failed with error: The remote procedure call failed. See the Microsoft-Windows-TWinUI/Operational log for additional information.
---
Faulting application name: HxMail.exe, version: 16.0.6769.4079, time stamp: 0x57038033
Faulting module name: KERNELBASE.dll, version: 10.0.14316.1000, time stamp: 0x5700c87e
Exception code: 0x00000004
Fault offset: 0x0000000000048658
Faulting process id: 0x1e8c
Faulting application start time: 0x01d19a5d686e86cf
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using ReactiveUI;
using Splat;
#!/bin/sh
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script is part of the slack package, modified from the google-chrome package.
#
# It creates the repository configuration file for package updates, since
# we cannot do this during the google-chrome installation since the repository
import {Observable, Subject} from 'rx';
import _ from 'lodash';
export default class TimedLocalStorage {
constructor(originalLocalStorage) {
this.inner = originalLocalStorage;
this.tick = new Subject();
this.count = 0;
this.elapsed = 0;
#!/usr/bin/env node
'use strict';
var main = function () {
var ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() {
var testServer = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var testRepo = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
var testCmdWithArgs = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
var cmdWithArgs, repo, server, _nwo, jobs, refInfo, nwo, surfUrl, fetchRefs, buildMonitor;
@anaisbetts
anaisbetts / Dockerfile
Created February 11, 2016 07:38
Docker + Surf + Electron
# VERSION: 0.1
# DESCRIPTION: Build an Electron app in a container
# AUTHOR: Paul Betts <paul@paulbetts.org>
# COMMENTS:
# Use Surf to build an Electron app in a container and upload the result
# Originally based on the Atom Dockerfile by Jessica
# Frazelle <jessie@docker.com>
# USAGE:
# # Download atom Dockerfile
# wget https://raw.githubusercontent.com/atom/atom/master/Dockerfile
@anaisbetts
anaisbetts / jobber.cpp
Created January 17, 2016 07:59
Collect a process into a job group, then let you kill it via writing to a pipe
// Jobber.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "Jobber.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
import rx from 'rx';
import requestRx from '../request-rx';
import connect from 'connect';
import semver from 'semver';
import _ from 'lodash';
import http from 'http';
import logger from '../logger';
// Public: This class handles updates via Squirrel for Mac (aka the 'auto-updater'
// module in Atom Shell). This class is complicated because we create a fake update
@anaisbetts
anaisbetts / example.html
Created December 22, 2015 17:06
ExecuteJavaScript returning a result
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Electron boilerplate</title>
<link rel="stylesheet" href="index.css">
<script>
window.foo = {};
window.foo.bar = {
baz: function(a,b) {