Skip to content

Instantly share code, notes, and snippets.

View dyoshikawa's full-sized avatar

dyoshikawa dyoshikawa

View GitHub Profile
version: '2'
services:
app:
image: dyoshikawa/laravel:php-72
volumes:
- .:/work
ports:
- 8000:8000
tty: true
from pathlib import Path
import os
def replace_all_file(files, class_name):
for file_path in files:
if ".git/" in str(file_path):
continue
if "volumes/" in str(file_path):
continue
from pathlib import Path
import os
def replace_all_file(files, model_name):
for file_path in files:
if ".git/" in str(file_path):
continue
if "volumes/" in str(file_path):
continue
@dyoshikawa
dyoshikawa / replace_words_all_files.py
Last active April 23, 2019 01:53
python3 ディレクトリ内の全てのファイルを置換する
from pathlib import Path
import os
def replace_all_file(files, model_name):
for file_path in files:
if ".git/" in str(file_path):
continue
if "volumes/" in str(file_path):
continue
@dyoshikawa
dyoshikawa / vue-calendar.vue
Last active March 5, 2019 09:09
vue+momentでカレンダーを実装するサンプル
<template>
<div>
{{ yearMonth }}
<button @click="goPrevMonth">prev</button>
<button @click="goNextMonth">next</button>
<table>
<tr>
<th>日</th>
>>> $user = User::find(5)
=> App\User {#2952
id: 5,
name: "test",
created_at: "2019-02-26 20:12:50",
updated_at: "2019-02-26 20:12:50",
}
>>> $user
=> App\User {#2952
id: 5,
$user = User::find($id); // ユーザを取得
$posts = $user->posts()->get(); // ユーザが持つ投稿一覧を取得
{
"name": "express-ts-parcel-example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "parcel --target node server.ts",
"build": "parcel build --target node server.ts",
"start": "node dist/server.js",
"type-check": "tsc --noEmit"
import express, { Request, Response } from "express";
const app = express();
app.get("/", (_req: Request, res: Response) => res.send("Hello World!"));
app.listen(3000, () => console.log("Example app listening on port 3000!"));
@dyoshikawa
dyoshikawa / config.yml
Last active December 28, 2018 04:48
config.yml laravel mysql
version: 2
jobs:
build:
docker:
- image: dyoshikawa/laravel:latest
environment:
APP_ENV: local
APP_KEY: base64:jRMWhl8pTIVapnvHyxOdrA6jOhFSKjj6zGhmx0NS6AM=
DB_CONNECTION: mysql
DB_USERNAME: root