Skip to content

Instantly share code, notes, and snippets.

View sakadon's full-sized avatar
🍀

さかどん sakadon

🍀
View GitHub Profile
@sakadon
sakadon / Breadcrumb.vue
Created February 20, 2018 12:46
vue-routerとコンポーネントファイルだけでページを量産する ref: https://qiita.com/sakadon/items/d1e0d1ee0e93d1b4b086
<template lang="pug">
nav
ul
li
router-link(to="/")
| HOME
li(v-for="list in breadcrumbs")
router-link(v-bind:to="list.path")
| {{ list.name }}
</template>
@sakadon
sakadon / file0.txt
Last active October 27, 2017 18:38
暗号化APFS環境で EFI Volume を消してしまった場合にどうするか ref: http://qiita.com/sakadon/items/3cd552138d915563791c
$ diskutil eraseVolume "Free Space" dummy disk0s1
@sakadon
sakadon / file0.txt
Last active December 2, 2016 03:44
Serverman@VPSでOpenVPNを作ってくれるbash ref: http://qiita.com/sakadon/items/e0040255e37f5dca648f
#!/bin/bash
cat <<__EOC__
OpenVPN install script for Serversman@VPS
__EOC__
# 実行時に指定された引数の数、つまり変数 $# の値が 2 でなければエラー終了。
if [ $# -ne 2 ]; then
echo "引数がたりません"
@sakadon
sakadon / file0.txt
Last active September 28, 2016 02:25
Sheetsu APIでの複数行(rows)POSTの実装 ref: http://qiita.com/sakadon/items/cfda5c80bcf170bda867
curl -X POST -H "Content-Type: application/json" https://sheetsu.com/apis/v1.0/ENDPOINT -d '{ "rows": [{"TimeStamp":"2016/9/27 1:23","undefined":"fuga"}, {"TimeStamp":"2016/9/28 2:34","undefined":"moga"}] }'
@sakadon
sakadon / file0.txt
Created November 28, 2015 13:35
waitをかけながらjQuery.each()の処理をやらせる ref: http://qiita.com/sakadon/items/7c3db275d5936940c710
# each entries
entries = objects
$.each entries, ( i, entry ) ->
setTimeout () ->
console.log 'say '+i
, 500*i
@sakadon
sakadon / fu*kgas.gs
Created November 28, 2015 13:02
Googleフォームから投稿された住所から経度緯度を検索しGoogleスプレッドシートに追記するやつ ref: http://qiita.com/sakadon/items/b99c7bd39fa6f3d0c53f
// 【GAS】住所から緯度経度を取得する
function getLocation(address) {
var requestUrl = "https://maps.googleapis.com/maps/api/geocode/json?address=" + address; // Google Geocoding API
var result = JSON.parse( UrlFetchApp.fetch(requestUrl) );
if ( result['status'] === 'ZERO_RESULTS' ) { return 'No Result.' }
var location = result['results'][0]['geometry']['location'];
return location['lat'] +','+ location['lng'];
}
@sakadon
sakadon / file0.txt
Last active November 26, 2015 09:17
ブロックチェーンって何?Ryan X. Charles氏のfullnode (alpha)を実行してみた ref: http://qiita.com/sakadon/items/f64a38fa647a05ca5d77
$ git clone git@github.com:ryanxcharles/fullnode.git
$ cd fullnode
$ npm install
$ gulp
$ chmod 777 bin/testapp.js
$ ./bin/testapp.js
@sakadon
sakadon / Gemfile
Last active November 10, 2015 07:51
railsでriotjsをセットアップする+riotjsからjsonをとってくる(via jQuery.get) ref: http://qiita.com/sakadon/items/c6d291c1798e18b739a5
gem 'riot_js-rails'
@sakadon
sakadon / file0.php
Last active November 7, 2015 11:21
Google APIs Client Library for PHPでgd:etagを取得する ref: http://qiita.com/sakadon/items/34552fb99669d6879466
$sheet_id = '#########';
$request = new Google_Http_Request(
"https://spreadsheets.google.com/feeds/worksheets/{$sheet_id}/private/full?alt=json",
"GET",
array(
"Authorization" => "Bearer {$this->token}",
"GData-Version" => "3.0"
)
);
@sakadon
sakadon / file0.php
Created November 6, 2015 19:38
オブジェクトに対して、オブジェクトを後ろに追加したい ref: http://qiita.com/sakadon/items/548703904bfe70df5d06
//$objects = 10個ぐらいで、
//$objects->name = 'unko' は3個としよう
$push = new ArrayObject();
foreach( $objects as $object ){
if( $object->name == 'unko' ){
$push->append( $object );
}
}
count($push); // -> 3