Skip to content

Instantly share code, notes, and snippets.

[INFO] Reading cached asset graph completed, took 470ms
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build completed, took 650ms
[INFO] Caching finalized dependency graph completed, took 338ms
[INFO] Reading manifest at build/.build.manifest completed, took 1ms
[INFO] Deleting previous outputs in `build` completed, took 135ms
[SEVERE]
[SEVERE]
[SEVERE] You have hit a bug in build_runner
[SEVERE] Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
var myInspector = require("inspector");
myInspector.open = function() {
console.log("FORGET IT!!");
throw new Error();
}
@ailabs-software
ailabs-software / gist:ff7a32a40d008d0fc665ea56d1636004
Created October 22, 2018 02:26
Connections being given out for wrong Postgres user!
I have configured two connections in pgbouncer.ini as separate databases, so that I may have different users with different settings (such as statement timeout being more harsh):
default_pool = dbname=elladb pool_size=70
analytics_pool = dbname=elladb user=analytics password=lorderulesz pool_size=10
pool_mode = transaction
My question is, with these settings, is it possible for a connection from analytics_pool to be given to a client requesting default_pool?
@ailabs-software
ailabs-software / gist:8bcf9daf62488198e9bd0a6df0cfba6a
Created September 6, 2018 03:28
First of each distinct value
class LordeSandwich
{
static List<E> firstOfEach<E, L>(Iterable<E> sourceIterable, ConsumerSupplierFunction<E, L> strategy)
{
Set<L> seenPrimaryKeys = new Set<L>();
List<E> list = new List<E>();
for (E element in sourceIterable)
{
targets:
$default:
sources:
- lib/**
- web/**
# Note that it is important to include these in the default target.
- pubspec.*
builders:
# -----------------------
build_web_compilers|entrypoint:
Unhandled exception:
type 'List<dynamic>' is not a subtype of type 'Iterable<XmlNode>' in type cast
#0 Object._as (dart:core/runtime/libobject_patch.dart:67:25)
#1 XmlGrammarDefinition.element.<anonymous closure> (package:xml/xml/grammar.dart:122:58)
#2 ActionParser.parseOn (package:petitparser/src/core/actions/action.dart:19:29)
#3 ChoiceParser.parseOn (package:petitparser/src/core/combinators/choice.dart:20:28)
#4 PossessiveRepeatingParser.parseOn (package:petitparser/src/core/repeaters/possesive.dart:28:29)
#5 SequenceParser.parseOn (package:petitparser/src/core/combinators/sequence.dart:21:32)
#6 ChoiceParser.parseOn (package:petitparser/src/core/combinators/choice.dart:20:28)
@ailabs-software
ailabs-software / gist:7b92a2a951fe343064633748740f68b7
Last active June 8, 2018 19:47
Typing a class with extends constraints.
abstract class TreeNode<C extends TreeNode, T extends INodeModel>
{
C treeRoot;
}
// Solved by re-creating the outer maps so the inner maps could be cast.
final results = new List< Map<Object, Map<Object, num> > >();
for (final value in windowValues)
{
Map<Object, Map<Object, num> > outerMap =
new Map<Object, Map<Object, num> >.fromEntries(
(value as Map).entries.map( (entry) => new MapEntry<Object, Map<Object, num> >(entry.key, (entry.value as Map).cast<Object, num>() ) )
);
@ailabs-software
ailabs-software / gist:0fc4e939e0c9d31d46786053ebf061cb
Created June 5, 2018 01:33
Casting iterable to iterable of map of maps.
// Fails to work. Cast exception occurs as soon a value is accessed by key from one of the outer maps:
// e.g., iterable[0][outerKey] results in CastError
Map<Object, Map<Object, num> > reduceOpaqueIterable(Iterable<Object> windowValues)
{
return windowValues.map(
(inner) => (inner as Map).cast<Object, Map<Object, num> >() );
}
shorty=# \d siteanalytics_pageview
Table "public.siteanalytics_pageview"
Column | Type | Modifiers
-------------------------+--------------------------+-----------------------------------------------
domain | integer |
visit_id | uuid |
pageview_id | uuid |
page_url | text |