This file contains hidden or 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
<?php | |
namespace App\Concerns; | |
use App\Casts\HashableKey; | |
trait CanRouteKeyHashing | |
{ | |
/** @var bool */ | |
protected $hashedKey = false; |
This file contains hidden or 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
<?php | |
if (! function_exists('random_float')) { | |
/** | |
* Generates random float number. | |
* | |
* @param int|float $min | |
* @param int|float $max | |
* @param int $digit | |
* @return float|int |
This file contains hidden or 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
<?php | |
use Illumniate\Support\Str; | |
if (! Str::hasMacro('character')) { | |
Str::macro('character', static function ($value, $positions, $glue = '') { | |
if (! is_array($positions)) { | |
$positions = [$positions]; | |
} |
This file contains hidden or 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
<?php | |
namespace App\Traits; | |
use Illuminate\Database\Eloquent\Model; | |
trait isSoftDeleting | |
{ | |
/** | |
* Determine if the model implements soft deletes and does soft deleting. |
This file contains hidden or 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
<?php | |
use Illuminate\Support\Facades\Validator; | |
Validator::extend('encrypted', function ($attribute, $value, $parameters, $validator) { | |
try { | |
return decrypt($value); | |
} catch (\Illuminate\Contracts\Encryption\DecryptException $exception) { | |
return false; | |
} |
This file contains hidden or 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
<?php | |
use Illuminate\Support\Facades\Route; | |
if (! Route::hasMacro('directory')) { | |
Route::macro('directory', function ($path, $attributes = [], $recursive = false) { | |
$route = $this; // for IDE | |
/** @var Route $route */ | |
return $route->group((array) $attributes, function () use ($path, $recursive) { | |
foreach (File::{$recursive ? 'allFiles' : 'files'}($path) as $file) { |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct TreeNode | |
{ | |
int data; | |
struct TreeNode *llink, *rlink; | |
} TreeNode; | |
/* |
This file contains hidden or 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
#include <stdio.h> | |
#include <malloc.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#pragma warning(disable:4996) | |
// 노드 정의 선언 | |
typedef struct | |
{ | |
int item; |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <malloc.h> | |
#pragma warning(disable:4996) | |
// 선택 정렬 | |
void SelectionSort(int list[], int n) | |
{ | |
int i, j, least, temp; |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#pragma warning(disable:4996) //scanf 에러문 무시 | |
// #define BUF_SIZE 100 // char 형태 데이터 | |
// #define NAME_SIZE 20 // char 형태 데이터 | |
typedef struct Node{ | |
int data; // int 형태 데이터 |