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
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/ | |
// |
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
@IonicPage() | |
@Component({ | |
selector: 'page-dashboard-design', | |
templateUrl: 'dashboard-design.html', | |
}) | |
export class DashboardDesignPage { | |
constructor( | |
private userSessionManager: UserSessionManager | |
} |
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
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. |
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
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; |
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
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')) { |
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
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"; |
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
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'; |
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
//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){ |
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
//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(); |
NewerOlder