Skip to content

Instantly share code, notes, and snippets.

View ogaty's full-sized avatar

Yuji Ogata ogaty

View GitHub Profile
@ogaty
ogaty / vue_js.md
Last active August 17, 2017 12:35
vue.jsメモ

propsて何だっけ

親テンプレートから子テンプレートにデータを渡す際に使用するパラメータ。

v-forにデータ渡し

<li v-for="list in lists" v-bind:data-id="list.id"> {{list.name}} </li>

@ogaty
ogaty / vagrant-storage.md
Created August 17, 2017 15:41
vagrant 容量up

書き途中

vmdk→vdi

vdi容量up

vdi→vmdk

virtualbox側でマウント

@ogaty
ogaty / idiorm.md
Created August 18, 2017 11:59
idiormを使ってみる

select * from person where age = 30;

$persons = ORM::for_table('person')
    ->where('age', 30)
    ->find_many();
$persons = ORM::for_table('person')
    ->where('age', 30)
    ->find_array();
@ogaty
ogaty / knockoutjsメモ.md
Last active August 18, 2017 16:37
knockout.js

ko.applyBindings

viewModelをバインドする

ko.applyBindings(myViewModel);

ko.observable、ko.observableArray

バインドする変数定義

var myViewModel = {
@ogaty
ogaty / js-mix.md
Last active November 14, 2017 13:02
browserifyとかgulpとか

問題点

laravel-mixやlaravel-elixirは重すぎて低スペッククラウドだと非常に時間がかかる
ので対処したい
gulp + browserify/webpack + vue.js(外部component)   が目標
なんだけど実際やると半端じゃなくややこしくなってくるのでまとめる。

browserify単体

これは単純。

@ogaty
ogaty / conky.conf
Last active June 3, 2018 01:08
conky
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[
Conky, a system monitor, based on torsmo
Any original torsmo code is licensed under the BSD license
All code written since the fork of torsmo is licensed under the GPL
Please see COPYING for details
@ogaty
ogaty / show-all-256-colors.py
Created August 6, 2018 10:37 — forked from mgedmin/show-all-256-colors.py
Script to show all 256 colors supported by xterms
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <marius@gedmin.as>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):
@ogaty
ogaty / alldirectories.php
Created September 8, 2018 04:10
特定ディレクトリ配下をrecursiveで探索 php directory
<?php
$path = 'node_modules';
function getFileList($dir) {
$iterator = new RecursiveDirectoryIterator($dir);
$iterator = new RecursiveIteratorIterator($iterator);
$list = array();
foreach ($iterator as $fileinfo) { // $fileinfoはSplFiIeInfoオブジェクト
if ($fileinfo->isFile() && preg_match('/\.js$/', $fileinfo->getPathname())) {
$list[] = $fileinfo->getPathname();
@ogaty
ogaty / couch.md
Last active September 30, 2018 07:27
couch couchdb

docker

docker run -d -p 5984:5984 -v /home/tea/couchdata:/opt/couchdb/data --name my-couchdb-vol couchdb

create database

curl -X "PUT" -H "Content-type:application/json" http://127.0.0.1:5984/series
@ogaty
ogaty / show-all-256-colors.py
Created October 7, 2018 03:37
Script to show all 256 colors supported by xterms
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <marius@gedmin.as>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):