Skip to content

Instantly share code, notes, and snippets.

View chihirokaasan's full-sized avatar

ChihiroMazda chihirokaasan

View GitHub Profile
@chihirokaasan
chihirokaasan / default.conf
Created May 9, 2019 04:17
MySQL5.7のデフォルトのmy.cnfを複製
server {
listen 80;
root /var/www/html;
index index.html index.htm index.php;
server_name localhost;
location / {
# First attempt to serve request as file, then
@chihirokaasan
chihirokaasan / index.vue
Created October 10, 2018 04:48
Nuxt.js title
<script>
export default {
head () {
return {
title: 'トップページ',
//titleTemplate: '', hide titleTemplate
}
}
}
</script>
<p v-on:click="toggleMenu">menuの開閉</p>
<div id="navMenu" :class="{'is-active': isActive}">
<menu>
<ul class="menu">
<li><a href="#">menu1</a></li>
<li><a href="#">menu2</a></li>
<li><a href="#">menu3</a></li>
<li><a href="#">menu4</a></li>
</ul>
</menu>
development:
adapter: mysql2
encoding: utf8
database: <%= ENV['DATABASE_DEV_NAME'] %>
pool: 5
username: <%= ENV['DATABASE_DEV_USER'] %>
password: <%= ENV['DATABASE_DEV_PASSWORD'] %>
host: <%= ENV['DATABASE_DEV_HOST'] %>
@chihirokaasan
chihirokaasan / doorkeeper.vue
Created May 18, 2018 18:26
doorkeeper apiからイベントを取得して表示
*pagesディレクトリに設置
<template>
<v-card class="mt-4 mb-4 pa-3">
<v-layout row wrap>
<v-flex xs4 v-for="(item,i) in data" :key="i">
<v-card class="blue ma-2">
<v-card-text><img :src="item.event.banner" width="100%"></v-card-text>
<v-card-text>{{item.event.title}}</v-card-text>
</v-card>
</v-flex>
@chihirokaasan
chihirokaasan / HTML
Last active March 19, 2018 05:54
Vue.jsによるformのselectによるリンクメニューの実装
<div id="target">
<select v-model="selected" v-on:change="jump">
<option v-for="option in options" v-bind:value="option.value">
{{ option.text }}
</option>
</select>
</div>
@chihirokaasan
chihirokaasan / HTML
Created March 19, 2018 05:05
formのselectによるリンクの遷移 jQuery
<select id="target">
<option value="https://www.yahoo.co.jp/">Yahoo!</option>
<option value="https://www.google.co.jp/">Google</option>
</select>
@chihirokaasan
chihirokaasan / Axios get
Created March 13, 2018 05:12
Axios.get
Axios.get('/post_url', {
params: {
// getで指定したいパラメータを記載
id: 123,
name: 'hoge',
}
})
.then(response => {
//200 status header etc...
// console.log(response)
import Vue from 'vue'
import Axios from 'axios'
import VueAxios from 'vue-axios'
Vue.use(VueAxios, Axios)
//以下コードをVue componentの中でよしなにつかってください
var token = 'csrf_token here'
@chihirokaasan
chihirokaasan / jQueryののajax post
Created March 13, 2018 03:33
jQueryのAjax postのサンプル
$('#selector').on('click',function(){
$.ajax({
url:'post/hogehoge',
type:'POST',
data:{
'data1': 'hogehoge',
'data2': ''hogehoge,
}
})
.done(function(data){