Skip to content

Instantly share code, notes, and snippets.

@noriaki
noriaki / Component.js
Created April 6, 2017 05:11
ESLint v3.19.0 is not supporting ES2016(es7) property initializers?
import React, { Component } from 'react';
class MyComponent extends Component {
state = {
open: false,
}
}
export default MyComponent;
@noriaki
noriaki / command line
Last active April 7, 2016 17:09
LINE BOT APIにちゃんとアカウント登録できてるか確認するためのcurlコマンド。{ほげほげ}の部分には管理画面の各値をあてはめる。レスポンスに自分の設定したアカウント情報が返ってくれば正しく登録できてる
curl -H "X-Line-ChannelID: {Channel ID}" \
-H "X-Line-ChannelSecret: {Channe lSecret}" \
-H "X-Line-Trusted-User-With-ACL: {MID}" \
"https://trialbot-api.line.me/v1/profiles?mids={MID}"
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 read client hello A
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 write server hello A
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 write certificate A
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 write key exchange A
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 write server done A
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_kernel.c(1853): OpenSSL: Loop: SSLv3 flush data
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_io.c(1929): OpenSSL: read 5/5 bytes from BIO#7f791f8c1600 [mem: 7f791f8c8c73] (BIO dump follows)
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_io.c(1862): +-------------------------------------------------------------------------+
[Thu Apr 07 21:43:56 2016] [debug] ssl_engine_io.c(1901): | 0000: 15 03 03 00 02 ..... |
[T
@noriaki
noriaki / (mac)Chrome_48.0.2564.116_(64-bit)_console_test.js
Last active March 16, 2021 12:43
Promise.allがブラウザ環境で並列実行されているか観察するコード via: http://ja.stackoverflow.com/questions/10363
console.profile('Promise.all');
console.time('Promise.all');
var obj = [
{a:"abc",b:123,c:true},
{a:"efg",b:456,c:true},
{a:"hij",b:789,c:false}
];
var promises = obj.map(function(data) {
@noriaki
noriaki / file0.txt
Created January 12, 2015 14:40
CentOS+Rails4+Apache2.2でPumaを動かす設定 ref: http://qiita.com/noriaki/items/74ee4877c0989a42399b
% mkdir -p tmp/pids
% mkdir -p tmp/sockets
/*
* Yet Another Sound-Novel
* WORK ONLY http://newclassic.jp/archives/4200
* Usage: exec in browser console. ex) chrome developer tools
*/
// parse text
var bbtext = function() {
var i = 0, t = jQuery('.story_main *:not(:has(img,script,noscript,iframe),img,script,noscript,iframe)').text().split('。');
return function() { return t[i++] + '。'; }
#!/bin/env ruby
# -*- coding: utf-8; mode: ruby; -*-
require "yaml"
if ARGV.size == 1
config = {}
database_url = ARGV.shift
params = database_url.split("/")
username = params[3]
host = params[2].split("@")[1]
ruby lib/get_pgdb_config.rb `heroku config -s |grep SHARED_DATABASE_URL`
heroku config:add FACEBOOK_APP_ID=000000000000000
heroku config:add FACEBOOK_SECRET=26cae7718c32180a7a0f8e19d6d40a59
heroku config:add LANG=ja_JP.UTF-8
$('#SELECTOR').on('keyup', function(e) {
if(e.keyCode == 13) { // Enter key code
do_something();
}
});