Skip to content

Instantly share code, notes, and snippets.

@hiroosak
hiroosak / primary_styling.css
Created January 21, 2014 23:03
Markdown Here CSS
/*
* NOTE:
* - The use of browser-specific styles (-moz-, -webkit-) should be avoided.
* If used, they may not render correctly for people reading the email in
* a different browser than the one from which the email was sent.
*/
/* This is the overall wrapper, it should be treated as the `body` section. */
.markdown-here-wrapper {
font-size: 1em;
@hiroosak
hiroosak / api.js
Created July 12, 2014 00:18
swagger-expressを使って簡単にAPIドキュメントを作成する ref: http://qiita.com/taizo/items/320d964e1cb81131de67
/**
* @swagger
* resourcePath: /api
* description: All about API
*/
/**
* @swagger
* path: /login
* operations:
@hiroosak
hiroosak / file0.txt
Created July 14, 2014 15:51
capistrano3のデプロイを把握する ref: http://qiita.com/taizo/items/afff46a260bd11588962
$ gem install capistrano
$ cap install
mkdir -p config/deploy
create config/deploy.rb
create config/deploy/staging.rb
create config/deploy/production.rb
mkdir -p lib/capistrano/tasks
Capified
$ cap staging deploy --dry-run
** Invoke staging (first_time)
@hiroosak
hiroosak / app.js
Last active August 29, 2015 14:04
Naive Bayesの確認
var _ = require('lodash');
var MeCab = require('mecab-async');
var mecab = new MeCab();
var async = require('async');
var textTraining = {
'Python': 'Python(パイソン)は、広く使用されている汎用のスクリプト言語である。コードのリーダビリティが高くなるように言語が設計されていると主張され、その構文のおかげで、Cなどの言語に比べて、より少ないコード行数でプログラムを表現することができる[11][12]と主張されている。小規模なプログラムから大規模なプログラムまで、さまざまなプログラムをクリアに書けるように、多くのコードが提供されている[13]。',
'Ruby': 'Ruby は当初1993年2月24日に生まれ、1995年12月にfj上で発表された。名称の Ruby は、プログラミング言語 Perl が6月の誕生石である Pearl(真珠)と同じ発音をすることから、まつもとの同僚の誕生石(7月)のルビーを取って名付けられた。 機能として、クラス定義、ガベージコレクション、強力な正規表現処理、マルチスレッド、例外処理、イテレータ、クロージャ、Mixin、演算子オーバーロードなどがある。Perl を代替可能であることが初期の段階から重視されている。Perlと同様にグルー言語としての使い方が可能で、C言語プログラムやライブラリを呼び出す拡張モジュールを組み込むことができる。 Ruby 処理系は、主にインタプリタとして実装されている(詳しくは#実装を参照)。 可読性を重視した構文となっている。Ruby においては整数や文字列なども含めデータ型はすべてがオブジェクトであり、純粋なオブジェクト指向言語といえる。 長らく言語仕様が明文化されず、まつもとによる実装が言語仕様に準ずるものとして扱われて来たが、2010年6月現在、JRuby や Rubinius といった互換実装の作者を中心に機械実行可能な形で明文化する RubySpec という試みが行われている。公的規格としては2011年3月22日にJIS規格(JIS X 3017)が制定され、その後2012年4月1日に日本発のプログラム言語では初めてISO/IEC規格(ISO/IEC 30170)として承認された [2
@hiroosak
hiroosak / file0.txt
Created July 21, 2014 14:34
Webサービス作るのに必要そうなのを色々入れたYeoman generator作ってみた ref: http://qiita.com/taizo/items/7bc27ad2aaa78e03787c
$ npm install -g generator-express-kick-starter
$ yo express-kick-starter
@hiroosak
hiroosak / app.js
Created July 22, 2014 22:54
テストランナーkarmaをとりあえず使ってみる方法 ref: http://qiita.com/taizo/items/04c80dcd2841cb1119a8
var Foo = function() {
};
Foo.prototype.sum = function(x, y) {
return x + y;
};
Foo.prototype.div = function(x, y) {
return x / y;
};
@hiroosak
hiroosak / index.html
Last active August 29, 2015 14:04
画像表紙テスト
<!doctype html>
<html>
<head>
<title>-</title>
<style>
body {
overflow: hidden;
margin: 0;
padding: 0;
@hiroosak
hiroosak / binding.gyp
Created July 26, 2014 16:13
node-gypを使ってnative addonを作成する (1) - Hello World ref: http://qiita.com/taizo/items/dee4ee85fe6f4e28428b
{
"targets": [
{
"target_name": "addon",
"sources": [
"hello.cc"
]
}
]
}
@hiroosak
hiroosak / async.cc
Created July 28, 2014 21:38
node-gypを使ってnative addonを作成する (2) - 非同期関数をとりあえず作ってみる ref: http://qiita.com/taizo/items/44bf02878f5fc0842703
#include <node.h>
#include <v8.h>
using namespace v8;
typedef struct asyncData {
Persistent<Function> callback;
const char *result;
} AsyncData;
@hiroosak
hiroosak / file1.go
Last active August 29, 2015 14:04
Go言語でhttpサーバーを立ち上げてHello Worldをする ref: http://qiita.com/taizo/items/bf1ec35a65ad5f608d45
package main
import (
"fmt"
"net/http"
)
type String string
func (s String) ServeHTTP(w http.ResponseWriter, r *http.Request) {