Skip to content

Instantly share code, notes, and snippets.

View miya0001's full-sized avatar

Takayuki Miyauchi miya0001

View GitHub Profile
{
"version": 8,
"name": "Geolonia Midnight",
"metadata": {},
"sources": {
"geolonia": {
"type": "vector",
"url": "https://api.geolonia.com/v1/sources?key=YOUR-API-KEY"
}
},
<?php
/**
* Plugin Name: _tarosky
* Plugin URI: https://tarosky.co.jp/
* Description: Fixes the some problems with our environment.
* Author: Takayuki Miyauchi
* Version: nightly
*
* @package _tarosky
*/
@miya0001
miya0001 / cli.md
Created February 22, 2020 12:28
WP-CLI
$ git clone https://github.com/wp-cli/extension-command.git
$ cd extension-command
$ composer install

このあと、このリポジトリのコマンドを実行するには、このディレクトリ内にいたまま WP-CLI コマンドを実行するといいです。

$ wp help theme --path=/path/to/wordpress
@miya0001
miya0001 / pi.js
Created August 19, 2019 02:07
Node + ピタゴラスの定理を使って円周率を計算する
#!/usr/bin/env node
const max = 1000000000;
let n = 6
let side1 = 0
let side2 = 1
let side3 = 1
#!/usr/bin/env bash
set -ex
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo ln -s /usr/bin/nodejs /usr/local/bin/node
@miya0001
miya0001 / tello.js
Last active December 21, 2018 13:38
tello 編隊飛行
#!/usr/bin/env node
'use strict'
const PORT = 8889;
const HOST = [
'192.168.43.208',
'192.168.43.19'
];
@miya0001
miya0001 / tello.js
Last active January 30, 2019 18:36
Tello + Node.js example
#!/usr/bin/env node
'use strict'
const PORT = 8889;
const HOST = '192.168.10.1';
const dgram = require('dgram');
const client = dgram.createSocket('udp4');
@miya0001
miya0001 / screenshot.js
Last active August 12, 2018 17:22
スクリーンショットをとる
const puppeteer = require('puppeteer');
async function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, delay));
}
(async () => {
const browser = await puppeteer.launch({
disable-gpu: true,
args: ['--no-sandbox']
@miya0001
miya0001 / ja.md
Last active June 25, 2018 22:25
Next generation of multibyte fix for WordPress

The length of the excerpt should be localizable.

We can make it localizable by adding number of the length into .po like following.

msgctxt "excerpt length"
msgid "40"

The length of the comment in dashboard should be localizable.

@miya0001
miya0001 / example.md
Created June 24, 2018 10:14
Jekyll Markdown Example
layout title date categories
post
Welcome to Jekyll!
2015-11-17 16:16:01 -0600
jekyll update

You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run bundle exec jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.