Skip to content

Instantly share code, notes, and snippets.

@gustavlrsn
gustavlrsn / location_scoping.md
Created February 8, 2023 12:58
Location scoping

Desired Outcomes

Primary

  1. A collective can indicate using some kind of geolocation where they are active.
  2. A collective can indicate where they are based using a precise mailing-address structure (this requirements seems at the moment to apply more for Europe then for the USA).
  3. Migrating the (tag-based) implementation in Discvoer to use "where do you operate" geolocation information.

Secondary

@gustavlrsn
gustavlrsn / pair_programming_roles
Created December 9, 2018 21:25 — forked from jordanpoulton/pair_programming_roles
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@gustavlrsn
gustavlrsn / Layout.js
Created May 1, 2017 18:11
Example bootstrap 4 integration into Next.js, with the reactstrap package
import Head from 'next/head'
import { Container } from 'reactstrap'
const Layout = (props) => (
<div>
<Head>
<title>PairHub</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
</Head>
@gustavlrsn
gustavlrsn / toFixedBankersRounding.js
Last active March 16, 2017 22:13
A toFixed method using bankers rounding
// A toFixed method using bankers rounding
var toFixedBankers = function(value, precision) {
// precision = checkPrecision(precision, lib.settings.number.precision);
// value = unformat(value);
var exponentialForm = Number(value + 'e' + precision);
// i = integer part, f = fractional part
var i = Math.floor(exponentialForm), f = exponentialForm - i;
var rounded = f === 0.5 ? ((i % 2 == 0) ? i : i + 1) : Math.round(exponentialForm);
Template.body.rendered({
$textarea = ('#textarea-selector', $(this.firstNode)); // Second argument establishes jQuery context
$textarea.autosize();
});