Skip to content

Instantly share code, notes, and snippets.

function cleanupGithub() {
const githubThreads = GmailApp.getUserLabelByName('Github Notifications').getThreads();
githubThreads.forEach(thread => {
const messages = thread.getMessages();
let threadDone = false;
const threadOld = isOld(thread.getLastMessageDate())
for (let message of messages) {
if (isDeploymentMessage(message)) {
console.log(`Deployment message (trashing message) ${message.getSubject()} (${message.getThread().getPermalink()})`)
@janv
janv / bug_tracking_triage_apenwarr.md
Last active November 26, 2019 08:45
Project management, bug tracking and triage

Project management, bug tracking and triage

This is a summary of https://apenwarr.ca/log/20171213, a very long and interesting article. I'm trying to present here only the ideas that are immediately relevant to our situation.

  • A lot of the article deals with scaling production operations and efficiency and examines the rate of bugs, postulates theories about how to manage projects and bugs and runs some statistical experiments to illustrate the postulated ideas.

  • Efficiency comes from smart project management.

  • Arbitrary, output-oriented goals to be met at the end of some deadline don't work, because they don't create urgency until the last minute, then fail to be effective, leading to a vicious cycle. While managers need goals and targets and estimates to plan ahead internally, estimation and goals should not be communicated to dev teams as such.

  • Do not get into a situation where engineers negotiate schedules with management. Motivation, project estimation, feature prioritization are all psychologi

#!/usr/bin/env bash
set -euo pipefail
file="/tmp/git-cleanup-branches-$(uuidgen)"
function removeCurrentBranch {
sed -E '/\*/d'
}
import React from 'react';
/**
* Use this to pass resource objects from Angular to React
*
* Usage:
* ```
* <ResourceObserver resource={someResource}>
* {(r) => <SomeComponent myProp={r}/>}
* </ResourceObserver>
@janv
janv / helpers.d.ts
Last active November 18, 2017 12:53
// The following helpers were found at
// https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-319495340
/**
* From https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458
* The Diff type is a subtraction operator for string literal types. It relies on:
* - T | never = T
* - T & never = never
* - An object with a string index signature can be indexed with any string.
*/
@janv
janv / .slate
Last active January 25, 2016 21:55
My slate config (https://github.com/jigish/slate)
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize in vertical direction, cycle through 1/3, 1/2, 2/3, full, either top or bottom. Up ends in full, Down ends in middle third
bind up:ctrl;alt;cmd chain move windowTopLeftX;0 windowSizeX;screenSizeY/3 | move windowTopLeftX;0 windowSizeX;screenSizeY/2 | move windowTopLeftX;0 windowSizeX;screenSizeY*2/3 | move windowTopLeftX;0 windowSizeX;screenSizeY
bind down:ctrl;alt;cmd chain move windowTopLeftX;screenSizeY*2/3 windowSizeX;screenSizeY/3 | move windowTopLeftX;screenSizeY/2 windowSizeX;screenSizeY/2 | move windowTopLeftX;screenSizeY/3 windowSizeX;screenSizeY*2/3 | move windowTopLeftX;screenSizeY/3 windowSizeX;screenSizeY/3
{
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
"browser": true
},
"ecmaFeatures": {
"modules": true,
"jsx": true
@janv
janv / watcher.js
Last active August 29, 2015 14:18
Watcher
function Watcher(expression, handler, deep) {
this._expression = expression;
this._handler = handler;
this._deep = deep;
this._old = undefined;
}
Watcher.prototype = {
digest: function(){
var _new = this.expression();
@janv
janv / patch-edid.rb
Created April 10, 2014 07:38
Create display override file to force Mac OS X to use RGB mode for Display
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
#
# Update 2013-06-24: added -w0 option to prevent truncated lines
require 'base64'
data=`ioreg -l -w0 -d0 -r -c AppleDisplay`
@janv
janv / fez.js
Created January 24, 2014 16:53
Simplest fez-file, doesn't work :(
'use strict';
var fez = require('fez');
var concat = require('fez-concat');
exports.build = function (stage) {
stage(function (rule) {
rule('app/assets/javascripts/*.js', 'dist.js', concat());
});
};