Skip to content

Instantly share code, notes, and snippets.

View barelyknown's full-sized avatar

Sean Devine barelyknown

View GitHub Profile
@barelyknown
barelyknown / business-answer-why-ember-4.md
Last active September 28, 2022 01:06
What does changing to Ember 4 mean for the XBE platform and users?

Ember is the framework that the client is built with. We started with Ember 1.x and have stayed updated with the various versions of ember through the years. The bet on ember, more than just the framework at the time, is on the Ember community, its core team, its roadmap, and its ideals. Ember is a productive framework and it’s a pretty big reason we’re able to have such a huge app built by such a small team.

Ember has one surprising upgrade philosophy: Upgrading to the new major version adds no new features. It only removes deprecated features. 4.0 will bring us no new features, but will make sure that our code base fits the newer specifications which are in some ways stricter and more robust. Better. The work to deprecate and get us ready for 4.0 was carried out over the past several months, lead by Hassan.

But in the same way Ember 3.0 didn’t bring in new features, Ember 3.13 established Octane, which brought with it several patterns like tracked properties and element modifiers and native classes, whic

@barelyknown
barelyknown / xbe-newsletter-37.md
Created November 9, 2020 20:32
We're not going to rename "Incidents" to "Opportunities", but we probably should!

If half the secret to optimizing operational performance is careful planning of each day's work, the other half is learning from all significant deviations between planned and actual performance so that avoidable issues aren't repeated. XBE calls this process "Incident Management", and it's the key to continuous improvement.

Most teams find incident management challenging for two main reasons:

  1. Strong cultural aversion to placing attention on mistakes and problems
  2. Unfamiliarity with continuous improvement tools

Culture eats strategy for breakfast.

When a company's culture makes incident management uncomfortable or punitive, familiarity with continuous improvement tools won't matter much. Therefore, let's focus first on what norms get in the way and what changes will make continuous improvement possible.

@barelyknown
barelyknown / query-all-mixin.js
Created November 28, 2017 04:03
Example mixin that queries for all records using Ember data, one page at a time.
import Mixin from '@ember/object/mixin';
import { inject } from '@ember/service';
import { get } from '@ember/object';
import { task } from 'ember-concurrency';
const PAGE_LIMIT = 10;
// Mixin anywhere you'd like to query for all records that match
// a filter, one page at a time. This can be helpful anywhere you need
// need all records loaded, but don't want to hit the server with long
// running requests.
class ComparisonValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return if options[:allow_blank] && value.blank?
return if options[:allow_nil] && value.nil?
unless comparison_attribute = options[:attribute]
raise ArgumentError, "missing attribute option"
end
unless operator = options[:operator]
@barelyknown
barelyknown / contributor_first_names.csv
Created September 2, 2016 03:49
The first names of contributors to The Information as of September 1, 2016.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
first_name
Aaron
Aaron
Abhilash
Adam
Adam
Adam
Adam
Adam
Aditya
@barelyknown
barelyknown / optimize-roster-3.js
Created December 9, 2015 16:28
optimize-roster-3.js
function setSolution(solution) {
// for each player
for (var row = 1; row <= PLAYERS.getNumRows(); row++) {
var playerId = PLAYERS.getCell(
row,
PLAYERS_PLAYER_COLUMN
).getValue();
// set the selected column based on the optimization solution
PLAYERS.getCell(
@barelyknown
barelyknown / optimize-roster-2.js
Created December 9, 2015 16:26
optimize-roster-2.js
function addSalaryCapConstraint(engine) {
// add a constraint for the overall salary cap
var salaryCapConstraint = engine.addConstraint(0, SALARY_CAP);
// for each player
for (var row = 1; row <= PLAYERS.getNumRows(); row++) {
var player = PLAYERS.getCell(
row,
PLAYERS_PLAYER_COLUMN
).getValue();
@barelyknown
barelyknown / optimize-roster-1.js
Created December 9, 2015 16:25
optimize-roster-1.js
function addPositionConstraints(engine) {
// for each position
for (var row = 1; row <= POSITIONS.getNumRows(); row++) {
var position = POSITIONS.getCell(
row,
POSITIONS_POSITION_COLUMN
).getValue();
var positionSpots = POSITIONS.getCell(
row,
POSITIONS_SPOTS_COLUMN
@barelyknown
barelyknown / optimize-roster-0.js
Created December 9, 2015 16:25
optimize-roster-0.js
function addVariables(engine) {
// for each player
for (var row = 1; row <= PLAYERS.getNumRows(); row++) {
var player = PLAYERS.getCell(
row,
PLAYERS_PLAYER_COLUMN
).getValue();
var projectedPoints = PLAYERS.getCell(
row, PLAYERS_PROJECTED_POINTS_COLUMN
).getValue();
@barelyknown
barelyknown / optimize-roster.js
Created December 9, 2015 16:23
optimize-roster.js
function optimizeRoster() {
// this sets engine to an instance of Google's LP/MIP solver
var engine = LinearOptimizationService.createEngine();
// clear previous selections from the Players worksheet
clearPreviousSelections();
// add the variables (players and their salaries)
// to the optimization problem
addVariables(engine);