This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isEmptyObject(obj) { | |
var p; | |
for (p in obj) { | |
return false; | |
} | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parentNode = document.body, | |
childNodes = parentNode.childNodes, | |
node; | |
while (1) { | |
// 1つを残して全部消す | |
if (childNodes.length === 1) { | |
break; | |
} | |
// 基本は先頭 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var audioContext = new AudioContext(); | |
function impulseResponse( duration, decay, reverse ) { | |
var sampleRate = audioContext.sampleRate; | |
var length = sampleRate * duration; | |
var impulse = audioContext.createBuffer(2, length, sampleRate); | |
var impulseL = impulse.getChannelData(0); | |
var impulseR = impulse.getChannelData(1); | |
if (!decay) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var isItemPage = location.pathname.split('/')[1] === 'item'; | |
if (isItemPage) { | |
var hasParam = location.search.length !== 0; | |
var addParam = hasParam ? '&storeId=2312' : '?storeId=2312'; | |
location.replace(location.href + addParam); | |
} | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mqtt = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
},{}],2:[function(require,module,exports){ | |
arguments[4][1][0].apply(exports,arguments) | |
},{"dup":1}],3:[function(require,module,exports){ | |
/*! | |
* The buffer module from node.js, fo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Model = require('Model'); | |
class Store { | |
constructor() { | |
extendObservable(this, { | |
items: asFlat([]), // wanna make this Array<Model> | |
}) | |
} | |
fooFunc(someData) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
($$('.js-stream-item').map(li => li.querySelector('.username > b').textContent).join(',')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 自身のプロトタイプに生えてるメソッドを列挙する。 | |
* | |
* @param instance: Class<T> - 対象のクラスのインスタンス | |
* @return Array<string> - メソッド名の配列 | |
* | |
*/ | |
const getProtoMethodNames = (instance) => { | |
const proto = Object.getPrototypeOf(instance); | |
return Object.getOwnPropertyNames(proto) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
["es2015", { "modules": false }], | |
"latest", | |
"react" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# BluetoothのON/OFFをtoggle実行するスクリプト | |
# | |
# http://brewformulas.org/Blueutil に依存してます。 | |
# | |
cur=($(blueutil power)) | |
if [ "$cur" -eq "1" ] |