Skip to content

Instantly share code, notes, and snippets.

@localdisk
localdisk / ubuntu-post-install.sh
Last active January 14, 2021 11:41
ubuntu-post-install.sh
#!/bin/bash
echo "install start."
# 時間をあわせる
sudo timedatectl set-local-rtc true
# add repository
# sudo add-apt-repository ppa:mattrose/terminator # terminator
sudo add-apt-repository ppa:atareao/atareao -y # screenkey
@localdisk
localdisk / brew.sh
Last active October 1, 2020 10:03
brew.sh
#!bin/sh
brew tap "homebrew/bundle"
brew tap "homebrew/cask"
brew tap "homebrew/core"
brew tap "sanemat/font"
brew tap "homebrew/cask-fonts"
# vsc
brew install "git"
@localdisk
localdisk / Tagify.php
Last active October 17, 2022 17:04
Livewire Tagify Component
<?php
namespace App\Http\Livewire;
use App\Models\Tag;
use Illuminate\View\View;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\Container\BindingResolutionException;
use Livewire\Component;
@localdisk
localdisk / Role.php
Created December 29, 2019 10:43
User Role sample.
<?php
class Role extends Model
{
public function users()
{
// permissions まで含めると morphedByMany がよさそう
return $this->belongsToMany(User::class);
}
}
@localdisk
localdisk / .php_cs
Last active September 30, 2019 01:29
俺なりの .php_cs
<?php
declare(strict_types=1);
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
@localdisk
localdisk / DevelopServiceProvider.php
Created October 12, 2018 02:27
DevelopServiceProvider
<?php
namespace Yaranaio\Providers;
use Barryvdh\Debugbar\Facade;
use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider;
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;
import firebase from 'firebase/app';
import 'firebase/auth';
import firebaseCofnig from '../config/firebase';
let _firebase;
let _provider;
export default class Auth {
static initialize() {
if (!_firebase) {
@localdisk
localdisk / auth.js
Created June 30, 2018 10:26
雑な Firebase Twitter login
import firebase from 'firebase/app';
import 'firebase/auth';
//export default Object.assign({}, {
// apiKey: process.env.MIX_FIREBASE_API_KEY,
// authDomain: process.env.MIX_FIREBASE_AUTH_DOMAIN,
//});
// ↑は config/firebase の内容
import firebaseCofnig from '../config/firebase';
@localdisk
localdisk / Cart.php
Created April 15, 2018 04:26
Interfaceとclassを1ファイル
<?php
declare(strict_types=1);
namespace Localdisk\Cart;
interface CartInterface
{
public function add(Product $product): void;
}
@localdisk
localdisk / .zshrc
Created October 4, 2016 05:36
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/matsuo/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"