Skip to content

Instantly share code, notes, and snippets.

View lesstif's full-sized avatar

KwangSeob Jeong lesstif

View GitHub Profile
@lesstif
lesstif / change-rocklinux-mirror.sh
Last active June 6, 2023 14:37
록키 리눅스(Rocky Linux) 미러(mirror)를 국내 포탈(navercloud)로 변경
#!/usr/bin/env bash
##
REPOS_FILES="AppStream BaseOS"
PARAM="hn"
#KAKAO="mirror.kakao.com\/centos"
NAVER="mirror.navercorp.com\/rocky"
@lesstif
lesstif / change-centos-mirror.sh
Last active December 7, 2023 15:25
change centos mirror to korea's portal.(CentOS 를 카카오와 네이버로 변경)
#!/usr/bin/env bash
BASE_REPOS=/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
PARAM="r:hkn"
KAKAO="mirror.kakao.com\/centos"
NAVER="mirror.navercorp.com\/centos"
if [ "$(id -u)" != "0" ]; then
echo "'$0' must be run as root" 1>&2
@lesstif
lesstif / winget-package-install.ps1
Last active November 3, 2023 02:32
windows package install using winget package manager
## copy from https://gist.github.com/cdekkerpossibilit/d023602c29fdf039c7eabadf64f708e9
function Confirm-Choice {
param (
[string]$Message
)
$yes = new-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Yes";
$no = new-Object System.Management.Automation.Host.ChoiceDescription "&No","No";
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no);
$answer = $host.ui.PromptForChoice("", $message, $choices, 1)
@lesstif
lesstif / phpstan.neon.dist
Last active October 4, 2023 12:58
phpstan.neon.dist for laravel
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters:
paths:
- app
# The level 8 is the highest level
level: 5
@lesstif
lesstif / Temperature.php
Created August 10, 2020 04:47
PHP mockery logic class.
<?php
namespace App;
class Temperature
{
private $service;
public function __construct($service)
{
@lesstif
lesstif / TemperatureTest.php
Created August 10, 2020 04:47
PHP Mockery simple example TestCase.
<?php
namespace Tests\Feature;
use App\Temperature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Mockery;
use Tests\TestCase;
@lesstif
lesstif / validation_biz_number.php
Last active May 20, 2022 09:56
사업자 등록 번호 검증 php code
<?php
/**
* 사업자 번호 유효성 검증
*
* @param string $bizNumberParam 검증할 사업자 번호
*
* @return bool
*
* @see https://www.lesstif.com/pages/viewpage.action?pageId=93126973 사업자 번호 검증 규칙
@lesstif
lesstif / EventServiceProvider.php
Last active August 5, 2021 04:27
Laravel Event Listener 을 이용한 eloquent query logging
<?php
namespace App\Providers;
use App\Listeners\LoggingEloquentQueryListener;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
@lesstif
lesstif / settings.json
Last active September 15, 2023 08:48
windows terminal settings json file for wsl2, wsl(Windows Subsystem For Linux)
// This file was initially generated by Windows Terminal 0.11.1191.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@lesstif
lesstif / my.cnf
Last active July 21, 2021 23:25
mysql 5.7 configuration for Linux distro
# For advice on how to change settings please see
# See MySQL 5.7 - http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# MySQL 8.0 - https://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysql]
local_infile=true
[mysqld]
local_infile=true