Skip to content

Instantly share code, notes, and snippets.

View Leko's full-sized avatar
🏠
Working from home

Shingo Inoue Leko

🏠
Working from home
View GitHub Profile
const setUp = () => {
const org = document.getElementById('_emoticon')
org.dispatchEvent(new MouseEvent('click'))
org.dispatchEvent(new MouseEvent('click'))
}
setUp()
const getter = (attr) => (obj) => obj[attr]
@Leko
Leko / chrome_web_store.md
Last active April 1, 2016 08:59
Chrome web store

Chrome web store for CLI

Install

curl -sS https://gist.githubusercontent.com/Leko/b89c2737034005c304b5d4c329fc9c73/raw/c4b7d8a95b35fb4b8a7e8875b2d29d4496c87b78/cws > /usr/local/bin/cws
chmod +x /usr/local/bin/cws

cws
@Leko
Leko / phpdoc
Last active March 31, 2016 04:25
PHPのドキュメントを開くツール
#!/usr/bin/env php
<?php
function help()
{
echo <<<HELP
Usage of phpdoc
Command:
@Leko
Leko / serial.js
Created March 15, 2016 03:32
シリアル番号っぽいものをランダム生成する
'use strict'
const shuffle = (list) => {
let i, j, temp
if (typeof list === 'string') {
list = list.split('')
} else if(Array.isArray(list)) {
list = list.slice()
}
i = list.length
@Leko
Leko / babel.html
Created February 9, 2016 16:04
Babel quick starter
<!DOCTYPE html>
<meta charset="UTF-8"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script type="text/babel">
'use strict'
// write code here!!
let foo = 'works!'
<?php
declare(ticks = 1);
class Pixel {
const BG_BLACK = 40;
const BG_RED = 41;
const BG_YELLOW = 43;
const COLOR_RESET = 49;
PLAY [default] ****************************************************************
GATHERING FACTS ***************************************************************
ok: [192.168.33.20]
TASK: [update apt-get] ********************************************************
ok: [192.168.33.20]
TASK: [upgrade apt-get] *******************************************************
changed: [192.168.33.20]
@Leko
Leko / webkitSpeechRecognition.md
Last active December 3, 2015 09:52
Chromeでの音声解析について調べてみた

Chromeの音声認識について調べてみた

精度

日本語で長い文章でもかなりの精度、認識率だった

  • TODO: 認識結果

Web Speech API

発話、音声認識ともにあるAPIだが、今回は発話は除外し音声認識についてだけ調査を行う

@Leko
Leko / CallCounter.php
Last active April 24, 2016 06:41
PHPでの便利なスニペット、関数、クラス
<?php
class CallCounter {
private $target;
private $counts = array();
public static function stub(&$target)
{
new self($target);
}
@Leko
Leko / invoker.php
Created November 5, 2015 07:45
集合操作、したいやん?
<?php
class Invoker implements ArrayAccess {
private $targets;
public function __construct(array $targets) {
$this->targets = $targets;
}
public function __call($method, array $args) {