Skip to content

Instantly share code, notes, and snippets.

View fokosun's full-sized avatar
:octocat:
I may be slow to respond.

fokosun fokosun

:octocat:
I may be slow to respond.
View GitHub Profile
@fokosun
fokosun / bWAPP easy setup
Last active December 19, 2018 15:55
setup bWAPP without WAMP or XAMPP or any Virtual machine
Important Note: PHP Version must be < version 5.5 if you are using version 7.0
you will need to use a VM like bee-box so you can have an isolated installation of PHP5.4 installed
Download and install bee-box: https://sourceforge.net/projects/bwapp/files/bee-box/
Download bWAPP: http://www.itsecgames.com/
Unzip the downloaded zipped folder
SETUP DATABASE:
@fokosun
fokosun / index.php
Created October 25, 2018 12:42 — forked from mchelen/index.php
php check multidimensional array for duplicate values
<?php
$arrays = array(
array(
'name'=>'foo',
),
array(
'name'=>'bar',
),
array(
'name'=>'foo',
@fokosun
fokosun / StatusRepository.php
Created May 19, 2018 15:11 — forked from laracasts/StatusRepository.php
Integration Testing Repositories That Use Eloquent (with Codeception)
<?php namespace Larabook\Statuses;
use Larabook\Users\User;
class StatusRepository {
/**
* Get all statuses associated with a user.
*
* @param User $user
<?php
namespace App;
use Illuminate\Auth\Authenticatable;
use Laravel\Lumen\Auth\Authorizable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable;
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Hashing\BcryptHasher;
/**
* Class UserController
@fokosun
fokosun / palindrome.php
Last active August 5, 2017 21:06
Stack Data structure
$letters = [];
$word = "racecar";
$rword = "";
for($i=0; $i<strlen($word); $i++) {
array_push($letters, $word[$i]);
}
for($i=0; $i<strlen($word); $i++) {
$rword = $rword . array_pop($letters);
@fokosun
fokosun / tymon-jwt-lumen5.4
Created July 24, 2017 14:23
How to install and configure tymon-jwt on Lumen5.4
pull in the package using composer
$ composer require tymon/jwt-auth:"^1.0@dev"
next run composer update
$ composer update
open AppServiceProvder and add the following code into the register method
you accidentally committed .idea and all it's gabbage, fix things by runnig the following on your terminal:
git rm --cached -r .idea
But first make sure add .idea to your .gitignore file like so:
.idea/*
commit then push!