Skip to content

Instantly share code, notes, and snippets.

View cimadai's full-sized avatar

Daisuke Shimada cimadai

  • Communitio Corporation.
View GitHub Profile
@cimadai
cimadai / admin@test.domain.priv
Last active January 26, 2018 02:28
iroha example conf for single node
1d7e0a32ee0affeb4d22acd73c2c6fb6bd58e266c8c2ce4fa0ffe3dd6a253ffb
@cimadai
cimadai / cmake_output.txt
Created August 8, 2017 03:41
iroha build error
$ sh docker/run-ametsuchi-dev.sh
...
I have no name!@39a278c945a5:/iroha$ cmake -H. -Bbuild; cmake --build build -- -j4;
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
Verifying that "cimadai.id" is my Blockstack ID. https://onename.com/cimadai
var plain = "I have a pen. I have an apple. Apple-pen!";
var encoded = "I oari a fib. I oari ab affwi. Affwi-fib!";
var cpA = "a".codePointAt(); // 97
var cpZ = "z".codePointAt(); // 122
var deltaOfAandZ = cpZ - cpA; // 25
function encode(str) {
var ret = [];
for (var i = 0, l = str.length; i < l; ++i) {
@cimadai
cimadai / index.jade
Created January 31, 2016 06:17
talktrans - client side
extends layout
block content
div(class="container-fluid")
div(class="row")
div(class="col-xs-12")
form
div(class="form-group")
label(for="input_text" class="step-message") Step1. 言語を選択
div(style="text-align:center;")
@cimadai
cimadai / app.js
Created January 31, 2016 06:10
talktrans - server side
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var app = express();
@cimadai
cimadai / DetectFaceDemo.scala
Created January 27, 2016 10:59
opencv3.1 usage of scala / sbt
import org.opencv.core.{Core, MatOfRect, Point, Scalar}
import org.opencv.imgcodecs.Imgcodecs
import org.opencv.imgproc.Imgproc
import org.opencv.objdetect.CascadeClassifier
object DetectFaceDemo extends App {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME)
// Create a face detector from the cascade file in the resources
// directory.
@cimadai
cimadai / chatwork-scala-usage.scala
Created January 24, 2016 15:31
Usage code snippet for chatwork-scala.
val apiKey = "YOUR API KEY FOR CHATWORK"
val cli = new ChatworkClient(apiKey)
cli.me()
cli.postRoomMessage("SOME CHATROOM ID", "A MESSAGE")
@cimadai
cimadai / sum.go
Created November 28, 2015 11:33
drone.io用のサンプルコード
package sample
func Sum(xs ...int) (s int) {
for _, x := range xs {
s += x
}
return
}
# sinatra でのリダイレクト設定
# http://.../hoge のような '/' なしを '/' ありへリダイレクト
# ただし、 http://example.com の場合は末尾 '/' が付く
get %r{^(.+[^/])$} do |c|
redirect c + "/", 303
end