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/
//
@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;
@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();
@bioyeneye
bioyeneye / AsyncImplementation.java
Created October 29, 2018 05:16 — forked from cutiko/AsyncImplementation.java
How to use Retrofit in Android
public clas AsyncImplementation extends AsyncTask<Void, Void, Void> {
/*Please read the rest of the explanation in the DefaultImplementation.java file. The difference between a default http request
and one using an AsyncTask is the enqeue() or the .execute() method*/
/*If you are passing params to the url, like it would be the case of the method post(long theDynamicParameter) you can
do it using replacing the void in the AsyncTask, in this case we are passing a Map so is passed in the constructor. Some times,
you would want the AsyncTask solve all the logic, then implements methods here to do it. Create the request http in a loop.
Use getter and setter to extends this to another class, etc.
Now in activity you can new AsyncImplementation(map).execute();*/
@bioyeneye
bioyeneye / MimeTypes.php
Created March 27, 2018 08:40 — forked from nimasdj/MimeTypes.php
List of MimeTypes mapped to file extensions
<?php
// I made this array by joining all the following lists + .php extension which is missing in all of them.
// please contribute to this list to make it as accurate and complete as possible.
// https://gist.github.com/plasticbrain/3887245
// http://pastie.org/5668002
// http://pastebin.com/iuTy6K6d
// total: 1223 extensions as of 16 November 2015
$mime_types = array(
'3dm' => array('x-world/x-3dmf'),
'3dmf' => array('x-world/x-3dmf'),
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Session;
use Illuminate\Support\Facades\Redirect;
use DB;
use Illuminate\Support\Facades\Storage;

CSV Seeder

Seed your database with CSV files

This package allows CSV based seeds.

Installation