Skip to content

Instantly share code, notes, and snippets.

@9wick
9wick / file0.txt
Created December 28, 2017 11:04
JSHintでasync/awaitに対応する ref: https://qiita.com/wicket/items/040fd7bdf748d810055d
Missing semicolon.
Missin name iin function declaration
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('orders', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
@9wick
9wick / file0.txt
Created January 15, 2018 02:21
Sequelize UIをつかってみた ref: https://qiita.com/wicket/items/ffd53f8007224c9adf02
require("db/index.js");
@9wick
9wick / file0.txt
Created January 29, 2018 07:49
Firebase storageでのグループ認証 ref: https://qiita.com/wicket/items/85115c4a6045f4d5fecd
{
users:{
userA : {
groups : {
groupA : true
groupB : true
}
},
userB : {
groups : {
@9wick
9wick / file0.txt
Last active February 5, 2018 04:37
macOSのアップデートをした後にsshキーが無いと言われた ref: https://qiita.com/wicket/items/da88cf2914e4f72842b3
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/master
Pushing to git@github.com:9wick/xxxx.git
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above
@9wick
9wick / file0.txt
Created February 7, 2018 02:54
Node.jsで単体testを書く際に,モジュールをstubに置き換える ref: https://qiita.com/wicket/items/af9a5d74608bedf97a85
var moduleStubs = {};
var originalJsLoader = require.extensions['.js'];
var stubOnModule = function(module) {
var path = require.resolve(module);
var stub = sinon.stub();
moduleStubs[path] = stub;
delete require.cache[path];
return stub;
@9wick
9wick / file0.txt
Created May 4, 2018 06:26
codemirrorのlint error/warningをモバイルでも表示する ref: https://qiita.com/wicket/items/709c9be0e73b868d85c2
CodeMirror.on(cm.display.scroller, "touchend", function (e) {
let touch = cm.display.activeTouch;
let date = new Date;
if (touch && touch.left != null &&
!touch.moved && date - touch.start < 300) {
//エディタの何処かをsingle tapした
if (!touch.prev) {
@9wick
9wick / file0.txt
Created May 11, 2018 12:24
javascriptの構文解析をしてみる ref: https://qiita.com/wicket/items/816c8703d23945462dfd
/**
* comment
*/
function printTips() {
var myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello world!';
}
@9wick
9wick / opencv.js
Last active August 16, 2018 09:00
This file has been truncated, but you can view the full file.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(function () {
return (root.cv = factory());
});
} else if (typeof module === 'object' && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
//モータドライバを用いて鉄道模型を制御するためのライブラリ
//十三車両製作所
//グローバル変数
var pwmNo1;
var pwmNo2;
var pwmNo3;
var pwmNo4;
var pwmNo5;
var pwmNo6;