Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

fokosun fokosun

🎯
Focusing
Block or report user

Report or block fokosun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stock_open_close_price_on_particular_weekdays.php
<?php
// 26-March-2001
// 15-August-2001
// Wednesday
// 1-January-2000
// 22-February-2000
// Monday
@fokosun
fokosun / php-calling-class-test.php
Created Jul 9, 2019 — forked from hamstar/php-calling-class-test.php
A function that will return the calling class to the class using it
View php-calling-class-test.php
/***********************************************************
******* SIMPLE TEST **/
class A {
function t() {
echo get_calling_class();
}
}
class B {
@fokosun
fokosun / bWAPP easy setup
Last active Dec 19, 2018
setup bWAPP without WAMP or XAMPP or any Virtual machine
View bWAPP easy setup
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 Oct 25, 2018 — forked from mchelen/index.php
php check multidimensional array for duplicate values
View index.php
<?php
$arrays = array(
array(
'name'=>'foo',
),
array(
'name'=>'bar',
),
array(
'name'=>'foo',
@fokosun
fokosun / StatusRepository.php
Created May 19, 2018 — forked from laracasts/StatusRepository.php
Integration Testing Repositories That Use Eloquent (with Codeception)
View StatusRepository.php
<?php namespace Larabook\Statuses;
use Larabook\Users\User;
class StatusRepository {
/**
* Get all statuses associated with a user.
*
* @param User $user
View User.php
<?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;
View create_users_table.php
<?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
View web.php
<?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.
|
View UserController.php
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Hashing\BcryptHasher;
/**
* Class UserController
@fokosun
fokosun / palindrome.php
Last active Aug 5, 2017
Stack Data structure
View palindrome.php
$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);
You can’t perform that action at this time.