Skip to content

Instantly share code, notes, and snippets.

View bioyeneye's full-sized avatar
🎯
Building it

Bolaji Oyeneye bioyeneye

🎯
Building it
View GitHub Profile
@bioyeneye
bioyeneye / PublicKeyCryptographyExample.cs
Created December 1, 2022 13:11 — forked from yetanotherchris/PublicKeyCryptographyExample.cs
Public key cryptography by example in .NET Core
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace PublicKeyCryptographyExample
{
//
// https://yetanotherchris.dev/security/public-private-key-in-netcore-by-example/
//
@IonicPage()
@Component({
selector: 'page-dashboard-design',
templateUrl: 'dashboard-design.html',
})
export class DashboardDesignPage {
constructor(
private userSessionManager: UserSessionManager
}
I think you need to register .net Freamework 4.0 for IIS for the above issue. Here are the steps..
Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied
Open Command prompt as Administrator
Navigate to "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory in command prompt [use the command cd C:\Windows\Microsoft.NET\Framework\v4.0.30319]
Register .net FrameWork for IIS [use command aspnet_regiis.exe -i]
Restart IIS [use command iisreset].
Done.
@bioyeneye
bioyeneye / AuthorizationController.cs
Created May 30, 2020 16:16
Resolving openiddict/openiddict-core request null
using System;
using System.Security.Claims;
using System.Threading.Tasks;
using AspNet.Security.OpenIdConnect.Primitives;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using OpenIddict.Abstractions;
using OpenIddict.Core;
using OpenIddict.EntityFrameworkCore.Models;
@bioyeneye
bioyeneye / user.controller.ts
Created April 25, 2020 08:50 — forked from animir/user.controller.ts
Nest.js prevent brute-force against authorisation example
import { Request, Response } from 'express';
import { Body, Controller, Post, Req, Res } from '@nestjs/common';
import { UserService } from './user.service';
import * as Redis from 'ioredis';
import { RateLimiterRedis } from 'rate-limiter-flexible';
const redisClient = new Redis({enableOfflineQueue: false});
const maxWrongAttemptsByIPperDay = 100;
const maxConsecutiveFailsByUsernameAndIP = 5;
import {App, Config, Loading, LoadingOptions, Platform} from "ionic-angular";
import {AccentColor} from "./constant-variables";
import {StatusBar} from "@ionic-native/status-bar";
export class GreenAccentController {
constructor(public platform: Platform,
public statusBar: StatusBar,) {
platform.ready().then(() => {
if (this.platform.is('android')) {
@bioyeneye
bioyeneye / AuthInterceptor.ts
Created March 12, 2019 16:09
ionic 3 interceptor
import {Observable, BehaviorSubject} from 'rxjs';
import {_throw} from "rxjs/observable/throw";
import {take, filter, catchError, switchMap, finalize} from 'rxjs/operators';
import {Injectable, Injector} from "@angular/core";
import {HttpInterceptor, HttpRequest, HttpHandler, HttpSentEvent, HttpHeaderResponse, HttpProgressEvent,
HttpResponse, HttpUserEvent, HttpErrorResponse} from "@angular/common/http";
import {ResetApiProvider} from "../providers/reset-api/reset-api";
import {Events} from "ionic-angular";
@bioyeneye
bioyeneye / app.module.ts
Created January 31, 2019 11:14 — forked from SyahmiNawi/app.module.ts
Ionic 3 Login & Register
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { IonicStorageModule } from '@ionic/storage';
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { HomePage } from '../pages/home/home';
@bioyeneye
bioyeneye / NearbyUser.java
Created October 29, 2018 05:27 — forked from amanjain08/NearbyUser.java
HyperTrack Android <> REST API network call. Steps: build.gradle > RetrofitServiceGenerator.java > RetrofitService.java > NearbyUser.java
//For nearby API you can pass actionId or latlng. For more info on nearbyAPI https://docs.hypertrack.com/api/entities/user.html#list-nearby-users
public void getNearbyUsers(String actionId, Latlng latlng){
//Create retrofit service object
RetrofitService getNearbyUserService = RetrofitServiceGenerator.createService(RetrofitService.class,context);
Call<UserListResponse> call = getNearbyUserService.getNearByUsers(actionID,latLng.latitude +","+latLng.longitude);
call.enqueue(new Callback<UserListResponse>() {
@Override
public void onResponse(Call<UserListResponse> call, Response<UserListResponse> response) {
if(response.isSuccessful()){
if(response.body() != null){
@bioyeneye
bioyeneye / retrofit-android-1
Created October 29, 2018 05:17 — forked from mberberoglu/retrofit-android-1
Retrofit Android
//Interface tanımlama
public interface UserService {
@GET("/users/{username}")
UserModel getUser(@Path("username") String name);
}
//Adapter ve servis oluşturma
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint("https://api.mustafab.net")
.build();