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
// Insert doc: | |
sections = [ | |
{ | |
slug:"introduction", | |
title:"Introduction", | |
videos:[ | |
{"k": "v0"}, | |
{"k": "v1"}, | |
{"_id": ObjectId('abcdefghijkl')} | |
] |
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
package isdebugging | |
import ( | |
"os" | |
"github.com/mitchellh/go-ps" | |
) | |
// IsDebugging will return true if the process was launched from Delve or the | |
// gopls language server debugger. |
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
<?php | |
declare(strict_types=1); | |
namespace Drupal\upgrade_status; | |
/** | |
* CheckedResult provides a format to return both a result and an error. | |
* | |
* When the error is not NULL, the result is to be ignored | |
*/ |
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
/** | |
* List the hosts referenced on a HTML page. | |
* | |
* Licence: MIT. | |
*/ | |
a = {}; | |
document.querySelectorAll("a[href],[src]").forEach((v, k) => { | |
const raw = v.getAttribute("href") || v.getAttribute("src"); | |
if (raw[0] !== "h") { |
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
function duplicateLinks(document) { | |
const elements = Array.from(document.body.getElementsByTagName('a')); | |
const linkElements = elements.filter((node, index) => { | |
const href = node.getAttribute('href'); | |
const isRemote = href && href.match(/^http/); | |
if (isRemote) { | |
return true; | |
} | |
}); |
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
const nodes = document.body.getElementsByTagName('*'); | |
const styles = {}; | |
for (const node of nodes) { | |
const s = getComputedStyle(node); | |
if (!styles[s.fontFamily]) { | |
styles[s.fontFamily] = {}; | |
} | |
if (!styles[s.fontFamily][s.fontWeight]) { |
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
console.log(Object.keys(Package).sort().map(x => ({ [x]: Object.keys(Package[x]).sort(), }))) | |
/* | |
Main use case: finding the name of the actual services available when you decide to adopt a | |
dependency injection pattern, especially with TypeScript, and import every needed package | |
instead of relying on the global availability provided by the Meteor runtime for /some/ of them. | |
*/ |
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
<?php | |
// Place in (module)/src/Commands | |
namespace Drupal\rdcm\Commands; | |
use Drush\Commands\DrushCommands; | |
use Robo\Common\OutputAwareTrait; | |
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | |
use Symfony\Component\Yaml\Yaml; |
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
Homebrew build logs for homebrew/php/php70 on macOS 10.12.1 | |
Build date: 2016-10-28 14:44:32 |
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
Homebrew build logs for homebrew/php/php70 on macOS 10.12.1 | |
Build date: 2016-10-28 14:44:32 |
NewerOlder