Skip to content

Instantly share code, notes, and snippets.

View dmba's full-sized avatar
🌴
On vacation

Dmytro Babiienko dmba

🌴
On vacation
View GitHub Profile
// 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) {
import 'package:flutter/material.dart';
class TabBarAndSliverPage extends StatelessWidget {
const TabBarAndSliverPage({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
class PublishController<T> implements StreamController<T> {
PublishController({
VoidCallback onListen,
VoidCallback onCancel,
bool sync = false,
T initialValue,
}) : _delegate = StreamController.broadcast(
onListen: onListen,
onCancel: onCancel,
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: HomePage(),
));
}
class HomePage extends StatefulWidget {
@override
{
"name": "node-training",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"syncprompt": "^2.0.0"
}
@dmba
dmba / app.js
Created April 23, 2019 12:48
Promt
var prompt = require('syncprompt');
var username = prompt("Username: ");
var password = prompt("Password: ", { secure: true });
console.log( "Username: %s\nPassword: %s", username, password );
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";