Skip to content

Instantly share code, notes, and snippets.

View mustafaaloko's full-sized avatar

Mustafa Ehsan Alokozay mustafaaloko

View GitHub Profile
@mustafaaloko
mustafaaloko / guess_game.py
Created February 11, 2024 17:01
Python Number Guess Game
import random
random_number = random.randint(1, 20)
chance = 5
for i in range(1, 6):
guess_number = int(input("Take a guess (" + str(chance) + " chances): "))
if guess_number == random_number:
print("You Won!")
exit()
@mustafaaloko
mustafaaloko / test_without_macro.php
Created March 22, 2019 17:57
Test without Macro
<?php
/** @test */
public function it_creates_a_user()
{
$response = $this->json('POST', '/api/user', ['name' => 'Ahmad']);
$response->assertStatus(Response::HTTP_CREATED);
}
@mustafaaloko
mustafaaloko / test_with_macro.php
Created March 22, 2019 17:56
Test with Macro
<?php
/** @test */
public function it_creates_a_user()
{
$response = $this->json('POST', '/api/user', ['name' => 'Ahmad']);
$response->assertCreated();
}
@mustafaaloko
mustafaaloko / AppServiceProvider.php
Created March 22, 2019 17:54
Macro in AppServiceProvider
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Collection;
class AppServiceProvider extends ServiceProvider
{
/**
@mustafaaloko
mustafaaloko / macro.php
Last active March 22, 2019 17:47
Laravel Macro Example
<?php
use Illuminate\Support\Collection;
Collection::macro('evens', function() {
return $this->filter(function($value) {
return $value % 2 === 0;
});
});
@mustafaaloko
mustafaaloko / settings.json
Created December 26, 2017 08:45
My Visual Studio Code Settings
// Place your settings in this file to overwrite the default settings
{
"editor.tabSize": 4,
"workbench.colorTheme": "GitHub Plus",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "Operator Mono",
"editor.fontSize": 14,
"editor.lineHeight": 40,
"editor.cursorStyle": "line",
"editor.quickSuggestions": {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="dist.css">
<title>Login</title>
...
borderWidths: {
default: '1px',
'0': '0',
'2': '2px',
'4': '4px',
'8': '8px',
'12': '12px' // Add it here
},
...
...
<div class="border-teal p-8 border-t-12 bg-white mb-6 rounded-lg shadow-lg">
<div class="mb-4">
<label class="font-bold text-grey-darker block mb-2">Username or Email</label>
<input type="text" class="block appearance-none w-full bg-white border border-grey-light hover:border-grey px-2 py-2 rounded shadow" placeholder="Your Username">
</div>
...
</div>
...
...
margin: {
'px': '1px',
'0': '0',
'1': '0.25rem',
'2': '0.5rem',
'3': '0.75rem',
'4': '1rem',
'6': '1.5rem',
'8': '2rem',