This file contains 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
/* | |
SortTable | |
version 2 | |
7th April 2007 | |
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ | |
Instructions: | |
Download this file | |
Add <script src="sorttable.js"></script> to your HTML | |
Add class="sortable" to any table you'd like to make sortable |
This file contains 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 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 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
// E.g used on | |
// https://www.crunchbase.com/search/principal.investors/8ff469dfad43f418bb327da3508ebddf | |
// Crunchbase hides search results behind a darker element and blurs the rows. This removes that | |
// so you can see the top 15 results instead of just 5. Though you won't be able to see beyond that. | |
document.querySelector('.all-results-upsell-wrapper').remove() | |
document.querySelectorAll('grid-row').forEach((it) => { it.setAttribute("class", "") }) |
This file contains 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
""" | |
Convert LocationHistory.json from Google takeout of location history (latitude) | |
to a usable KML file for viewing in Google Earth. | |
Usage: | |
python json_history_to_kml.py LocationHistory.json | |
This file contains 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 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
import subproc | |
import time | |
subproc.Popen('calc') | |
print('now close this window and see calc closing itself') | |
while True: | |
time.sleep(1) |
This file contains 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 findMetrics(el) { | |
return el.textContent; | |
} | |
function findNodes(el) { | |
return el.querySelectorAll('#metadata-line'); | |
} | |
function isDigit(str) { | |
return str.length === 1 && str.match(/[0-9]/i); |
This file contains 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
// An example race condition in JavaScript | |
// When you run this script using Node or in a browser, you'll find it | |
// does not print "Ended with 0", but a random number. Even though the functions running | |
// simply loop 100 iterations of adding and subtracting. The reason the end result is random | |
// is because the sleeps are of random duration and the time between the read of the variable | |
// causes the eventual write to be incorrect when `adder` and `subber` interleave. | |
// This problem is similar to https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use | |
let number = 0; | |
const times = 100; |
This file contains 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; | |
} |
NewerOlder