Skip to content

Instantly share code, notes, and snippets.

View KangYoosam's full-sized avatar
🏠
Working from home

Kang Yoosam KangYoosam

🏠
Working from home
View GitHub Profile
@KangYoosam
KangYoosam / MigrateSessionToRedisFromFile.php
Created February 6, 2020 08:32
【Laravel】File管理していたsession情報をredisに移行するコマンド
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
class MigrateSessionToRedisFromFile extends Command
{
/**
@KangYoosam
KangYoosam / file0.txt
Created December 29, 2018 03:27
Redisのバックアップファイル場所をチェックする ref: https://qiita.com/kangyoosam/items/6775ebc72746dd03561a
redis-cli bgsave
update user set email = replace(email, left(email, instr(email, '@')-1),concat('xxxxxxx_', id));
@KangYoosam
KangYoosam / file0.php
Last active March 19, 2018 05:34
Laravel5.3のQueue非同期処理 (AWS3へ画像アップロード) ref: https://qiita.com/kangyoosam/items/0ef7822aaac0883175b7
<?php
namespace App\Jobs;
use App\Models\Channel;
use File;
use Storage;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
@KangYoosam
KangYoosam / file0.txt
Created February 18, 2018 08:06
【メモ】コマンドラインからPull Requestを出すシェル関数 ref: https://qiita.com/kangyoosam/items/67f30ca49a275732349d
# opens a PR from the current branch
function opr() {
parentBranch=$1
currentBranch=`git branch | grep "*"`
repoName=$(git remote show origin -n | ruby -ne 'puts /^\s*Fetch.*:(.*).git/.match($_)[1] rescue nil')
open -a /Applications/Google\ Chrome.app https://github.com/${repoName/* /}/compare/${parentBranch/* /}...${br/* /}
}
0 3 * * * cd /path_to_your_git_root_directory; git add -A; git commit -m "Daily backup"; git push origin master;
// 同じ名前のメソッドが存在しないかチェック
if (! Collection::hasMacro('transpose')) {
/*
* Transpose an array.
*
* @return \Illuminate\Support\Collection
*/
Collection::macro('transpose', function () {
$items = array_map(function (...$items) {
return $items;
@KangYoosam
KangYoosam / gist:ad492d28299ce0f9aaf1dd9966f431fd
Created November 6, 2016 16:55
Navmeshでターゲットの方向へ向かっていく
public class Move : MonoBehaviour {
public GameObject target;
void Start () {
NavMeshAgent agent = GetComponent<NavMeshAgent> ();
agent.speed = 1;//このようにスクリプトからNavMeshのプロパティをいじれる。
agent.destination = target.transform.position;
}
}