This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
import 'dart:ui'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: function findNodes(el) { | |
return el.querySelectorAll('#vote-count-middle'); | |
} | |
function isDigit(str) { | |
return str.length === 1 && str.match(/[0-9]/i); | |
} | |
function metricVal(el) { | |
let modifiers = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into JS to find an ACE editor in your browser window | |
// Based off of https://stackoverflow.com/questions/12102425/recursively-search-for-a-value-in-global-variables-and-its-properties/12103127#12103127 | |
function isTarget(obj) { | |
// return typeof obj == typeof value && obj == value | |
if (obj && obj['getModel'] && obj.getModel() && obj.getModel().getValueInRange) { | |
const highlight = obj.getModel().getValueInRange(obj.getSelection()) | |
if (highlight) { | |
console.log('highlight', highlight); | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this into JS to find an ACE editor in your browser window | |
// Based off of https://stackoverflow.com/questions/12102425/recursively-search-for-a-value-in-global-variables-and-its-properties/12103127#12103127 | |
function isTarget(obj) { | |
// return typeof obj == typeof value && obj == value | |
return obj && obj['getSelectedText']; | |
} | |
function globalSearch(startObject, isTargetFunc) { | |
var stack = [[startObject, '']]; | |
var searched = []; | |
var found = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: function findNodes(el) { | |
return el.querySelectorAll('.score'); | |
} | |
function isDigit(str) { | |
return str.length === 1 && str.match(/[0-9]/i); | |
} | |
function metricVal(el) { | |
let modifiers = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dateEls = [...document.querySelectorAll('relative-time')] | |
dates = dateEls.map(it => new Date(it.attributes['datetime'].textContent)); | |
durations = []; | |
for (const [i, dt] of dates.entries()) { | |
const hours = Math.round((dates[i] - dates[i + 1]) / 3600e2) / 10; | |
const newNode = document.createTextNode("- took hours " + hours); | |
dateEls[i].parentNode.appendChild(newNode); | |
durations.push(hours) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Simplest Math Problem No One Can Solve | |
// https://www.youtube.com/watch?v=094y1Z2wpJg | |
// https://en.wikipedia.org/wiki/Collatz_conjecture | |
// I'm looking for loops by checking every positive integer (1, 2, 3...) | |
// and I'm using the binary representation (0b0, 0b10, 0b11, 0b100, ...) | |
// as an up and down path of a collatz loop where '1' means (3x+1)/2 and | |
// '0' means x/2 . `frac_follow_path` calculates what should be the starting | |
// value based on that collatz loop path, and if that's an integer - | |
// we found a loop. | |
// Problems so far: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The Simplest Math Problem No One Can Solve - YouTube - https://www.youtube.com/watch?v=094y1Z2wpJg | |
Collatz Conjecture | |
3x + 1 | |
x / 2 | |
(3x + 1) / 2 = 1.5x + 0.5 | |
3(x/2) + 1 = 1.5x + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: function findNodes(el) { | |
return el.querySelectorAll('#metadata-line'); | |
} | |
function isDigit(str) { | |
return str.length === 1 && str.match(/[0-9]/i); | |
} | |
function metricVal(el) { | |
let modifiers = { |
NewerOlder