Skip to content

Instantly share code, notes, and snippets.

View corean's full-sized avatar

corean corean

  • connple co., ltd.
  • chuncheon, korea
  • 20:24 (UTC +09:00)
View GitHub Profile
@corean
corean / usage
Last active September 4, 2017 01:19
[Laravel-Permission]
//Role 지정
$user->assignRole('관리자')
//$user의 모든 roles 리턴
$user->roles()->pluck('name');
//Role 삭제
$user->removeRole('writer');
@corean
corean / jumin.js
Created September 21, 2017 04:35 — forked from composite/jumin.js
주민등록번호 생성기 (주민번호 로직 들어가는 양식 테스트용. 개발 외 목적 사용 금지, 이 프로그램 사용에 대한 법적 책임 일체 없음.)
/**
* 주민번호 생성기
* 사용예) jumin()
* jumin({year:1990, month:3, day: 12, loop: 10}); //1990년 3월 12일생 10개 주민번호 생성.
* 확인예) jumin.verify(확인할 주민번호) 확인할 주민번호는 - 있어도 없어도 무관. 13자리만 맞추면 됨.
* @param {object} options 옵션
* year: 년도, 빈 값으면 랜덤
* month: 월, 빈 값이면 랜덤
* day: 일, 빈 값이면 랜덤
* loop: 생성개수, 빈 값이면 1개 생성.
@corean
corean / uuidTrait.php
Last active February 8, 2018 18:43
UUID #laravel #trait
trait UuidTrait
{
/**
* Defines the UUID field for the model.
* @return string
*/
protected static function uuidField()
{
return 'uuid';
}
pmset -g
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
//mdworker disable
sudo mdutil -a -i off
//mdwork enable
sudo mdutil -a -i on
@corean
corean / if.php
Created May 8, 2018 03:54
php if AND연산자 확인용
<?php
echo ((true&&true)?'true<br>':'false<br>');
echo ((true&&false)?'true<br>':'false<br>');
echo ((false&&true)?'true<br>':'false<br>');
echo ((false&&false)?'true<br>':'false<br>');
/*
true
false
false
false
@corean
corean / debugbar.css
Last active September 4, 2023 06:16
debugbar.css
/* debugbar.css */
body div.phpdebugbar {
font-size: 10px;
}
body div.phpdebugbar-header > div > * {
font-size: 10px;
padding: 2px 5px;
}
@corean
corean / app\Providers\AppServiceProvider.php
Created May 26, 2018 06:01
Specified key was too long; max key length is 767 bytes
/*
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
*/
use Illuminate\Support\Facades\Schema;
@corean
corean / span.js
Created June 1, 2018 01:34
table cell merge rowspan,colsapn using jQuery
/**
*
* 같은 값이 있는 열을 병합함
*
* 사용법 : $('#테이블 ID').rowspan(0);
*
*/
$.fn.rowspan = function(colIdx, isStats) {
return this.each(function(){
var that;
@corean
corean / filter-v4150
Last active June 2, 2019 23:59
SynologyDrive Filter (~/.SynologyDrive/SynologyDrive.app/Contents/Resources/conf/filter-v4150)
[Version]
major = 1
minor = 1
[Common]
black_char = "\\/"
black_name = "@tmp", "@eaDir", ".SynologyWorkingDirectory", "#recycle", "desktop.ini", ".ds_store", "Icon\r", "thumbs.db", "$Recycle.Bin", "@sharebin", "System Volume Information", "Program Files", "Program Files (x86)", "ProgramData", "#snapshot", "vendor", "node_modules", "framework", "debugbar"
max_length = 255
max_path = 768
public function setItemsAttribute(array $items): void
{
static::saved(function (self $model) use ($items) {
$this->items()->sync($items);
});
}