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); | |
use Directus\Services\AuthService as DirectusAuthService; | |
use Directus\Authentication\Exception\UserNotFoundException; | |
class AuthService | |
{ | |
private function getToken($req) |
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
Open your console. | |
<script src="event-source.js"></script> |
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 | |
/** | |
* Filter an array of objects. | |
* | |
* You can pass in one or more properties on which to filter. | |
* | |
* If the key of an array is an array, then it will filtered down to that | |
* level of node. | |
* |
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
/** | |
* Produces a function which uses template strings to do simple interpolation from objects. | |
* | |
* Usage: | |
* var makeMeKing = generateTemplateString('${name} is now the king of ${country}!'); | |
* | |
* console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'})); | |
* // Logs 'Bryan is now the king of Scotland!' | |
*/ | |
var generateTemplateString = (function(){ |
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
// Dletta has implemented a depth-first (and sort of breadth-first) search algorithm for gun graphs. | |
var stack; | |
var nodes; | |
var edges; | |
var start; | |
var u; | |
var label; | |
var opt = 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
/* | |
Lightweight PUBLISH / SUBSCRIBE Class | |
Original code from: <http://blog.bobcravens.com/2011/01/loosely-coupled-javascript-using-pubsub/> | |
Can be initialized on other Objects to provide pub/sub functionality within that object | |
ex: this.events = new PubSub(); | |
*/ |
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
Expected Result: | |
---------------- | |
One | |
Two | |
Three | |
Four | |
Six |
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
#!/usr/bin/env bash | |
set -eo pipefail | |
# from moby project - w/o go dependency (nailing amd64) and w/o jq dep (using | |
# python) | |
# hello-world latest ef872312fe1b 3 months ago 910 B | |
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B | |
# debian latest f6fab3b798be 10 weeks ago 85.1 MB | |
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB |
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
Object.prototype.emit = function(name, d) { | |
this.dispatchEvent(new CustomEvent(name, { detail: d })); | |
return this; | |
}; | |
Object.prototype.on = function(name, cb) { | |
this.addEventListener(name, cb, false); | |
return cb; | |
}; | |
Object.prototype.once = function(name, cb) { | |
var wrapper = function() { |
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
// The core app code | |
var myApp = (function () { | |
'use strict'; | |
// Create a public methods object | |
var methods = {}; | |
/** | |
* Extend the public methods object |
OlderNewer