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
// A demonstration of secret retrieval from JWKS, inspired by the discussion in the comments section of this wonderful article: | |
// https://medium.com/nerd-for-tech/nestjs-firebase-auth-secured-nestjs-app-using-passport-60e654681cff | |
import {Injectable} from '@nestjs/common'; | |
import {PassportStrategy} from '@nestjs/passport'; | |
import {ExtractJwt, Strategy} from 'passport-jwt'; | |
import * as jwksRsa from 'jwks-rsa'; | |
@Injectable() | |
export class AuthStrategy extends PassportStrategy(Strategy) { |
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
import 'package:flutter/material.dart'; | |
class TabBarAndSliverPage extends StatelessWidget { | |
const TabBarAndSliverPage({ | |
Key key, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( |
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
class PublishController<T> implements StreamController<T> { | |
PublishController({ | |
VoidCallback onListen, | |
VoidCallback onCancel, | |
bool sync = false, | |
T initialValue, | |
}) : _delegate = StreamController.broadcast( | |
onListen: onListen, | |
onCancel: onCancel, |
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
home: HomePage(), | |
)); | |
} | |
class HomePage extends StatefulWidget { | |
@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
{ | |
"name": "node-training", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"start": "node app.js" | |
}, | |
"dependencies": { | |
"syncprompt": "^2.0.0" | |
} |
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
var prompt = require('syncprompt'); | |
var username = prompt("Username: "); | |
var password = prompt("Password: ", { secure: true }); | |
console.log( "Username: %s\nPassword: %s", username, password ); |
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
package com.dmba.myapplication; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.webkit.WebView; | |
import android.widget.Toast; | |
public class MainActivity extends Activity { | |
static final String URL = "http://mydevice.io"; |