Skip to content

Instantly share code, notes, and snippets.

import { makeFoo, makeBar } from "./providers.js"
/**
* Create property `name` on `obj` that will run `provider`'s factory method the first time
*/
function makeLazyGetter(obj, name, provider){
let value
Object.defineProperty(obj, name, {
get: function(){
if(!value){
@rektide
rektide / cargo-build-log
Last active September 9, 2018 23:03
issues compiling input.rs
Downloading libc v0.2.43
Downloading bitflags v1.0.4
Downloading udev v0.2.0
Downloading libudev-sys v0.1.4
Downloading pkg-config v0.3.14
Compiling pkg-config v0.3.14
Compiling input-sys v1.9.0 (file:///home/rektide/src/archive/input.rs/input-sys)
Compiling libc v0.2.43
Compiling bitflags v1.0.4
Compiling libudev-sys v0.1.4
@rektide
rektide / basic
Last active January 5, 2018 04:39
Trying to launch xlogo in xpra via the system service
$ xpra start --start=xlogo --start-via-proxy=yes
2018-01-04 22:39:09,965 server failure: disconnected before the session could be established
2018-01-04 22:39:09,966 server requested disconnect: server error (error accepting new connection)
2018-01-04 22:39:09,971 Error: printing disabled:
2018-01-04 22:39:09,971 No module named cups
xpra initialization error:
failed to start-via-proxy: unknown general failure
$ sudo journalctl -xef -u xpra
Jan 04 22:39:09 nanomachine xpra[17604]: New unix-domain connection received on /run/xpra/system
@rektide
rektide / terminal.log
Created November 27, 2017 01:26
xpra start error
$ xpra start :99
Warning: invalid option: 'shadow-fullscreen'
Warning: cannot use the system proxy for 'start' subcommand,
failed to connect to '/run/xpra/system':
[Errno 111] Connection refused
Warning: invalid option: 'shadow-fullscreen'
InitException: cannot open log file '${HOME}/.xpra/:99.log': [Errno 2] No such file or directory: '${HOME}/.xpra/:99.log'
xpra initialization error:
cannot open log file '${HOME}/.xpra/:99.log': [Errno 2] No such file or directory: '${HOME}/.xpra/:99.log'
@rektide
rektide / hipchat-apt-key-add.log
Last active August 2, 2017 20:27
hipchat install on Debian/stretch
wget -O - https://atlassian.artifactoryonline.com/atlassian/api/gpg/key/public | sudo apt-key add -
--2017-08-02 16:01:43-- https://atlassian.artifactoryonline.com/atlassian/api/gpg/key/public
Resolving atlassian.artifactoryonline.com (atlassian.artifactoryonline.com)... 34.225.205.210, 52.44.119.99
Connecting to atlassian.artifactoryonline.com (atlassian.artifactoryonline.com)|34.225.205.210|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1641 (1.6K) [text/plain]
Saving to: 'STDOUT'
- 100%[================================================>] 1.60K --.-KB/s in 0s
@rektide
rektide / promiseOriginMonkeypatch.js
Last active June 28, 2017 20:27
monkeypatch tracking origins onto Promise
var promiseSource = new WeakMap()
(function(){
const promiseConstructor = Promise.constructor
Promise.constructor = function(fn){
console.log("monkeypatch successful")
promiseConstructor.call(this, fn)
promiseSource.set(this, new Error().stack)
}
}())
var sample = new Promise(x => x(42)) // expecting: "monkeypatch successful"
@rektide
rektide / pain.md
Last active May 2, 2017 23:36
Post Ansible 2.1 Pain

In the releases after Ansible 2.1, a vast amount of the expressivitiy in Ansible went away or broke.

I was in pain and hurting. I started trying to to upstream things I needed to continue on, but the templating situation post 2.1 was really bad with no signs of recovery to the once pristine state.

I somewhat dramatically opined, about what felt like a world I had built upon shattering,

Damnit Ansible could you have done any more to ruin it all.

Your fall has cast a horrible pall over all good things in this world. The birds no longer chirp. The grass is dead.

@rektide
rektide / cloudformation.user.js
Last active February 8, 2017 20:28
Userscript to add a "term" parameter in the url to allow filtering of CloudFormation listings
// ==UserScript==
// @name CloudFormation Filter
// @namespace http://tampermonkey.net/
// @version 0.99a
// @description add filterability to the CloudFormation URL template via a "term" query parameter in the hash
// @author rektide
// @match https://console.aws.amazon.com/cloudformation/home*
// @grant none
// ==/UserScript==
@rektide
rektide / ansible-dict-iter.yaml
Last active December 15, 2021 16:39
Ansible dictionary iteration
---
- hosts: all
vars:
places:
alpha: /home
epsilon: /nopenopenope
tasks:
- name: "changed_when depending on result, in with_items"
shell: "[[ '{{item}}' != 'alpha' ]]"
@rektide
rektide / gmusicapi-ifl-random.py
Last active January 9, 2017 01:41
GMusicAPI playing IFL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import * # noqa
from getpass import getpass
from gmusicapi import Mobileclient