Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊
🐈 🐈 🐈

nukosuke nukosuke

🍊
🐈 🐈 🐈
View GitHub Profile
View install_plenv.sh
#!/bin/sh
git clone https://github.com/tokuhirom/plenv.git $HOME/.plenv
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> $HOME/.bashrc
echo 'eval "$(plenv init -)"' >> $HOME/.bashrc
PATH=$HOME/.plenv/bin:$PATH
eval "$(plenv init -)"
git clone https://github.com/tokuhirom/Perl-Build.git $HOME/.plenv/plugins/perl-build/
View install_activator.sh
#!/bin/sh
https://downloads.typesafe.com/typesafe-activator/1.3.10/typesafe-activator-1.3.10.zip
unzip typesafe-activator-1.3.10.zip
mv typesafe-activator-1.3.10 $HOME/.activator
echo 'export "PATH=$PATH:$HOME/.activator/bin"' >> $HOME/.bashrc
View .travis.yml
language: node_js
node_js:
- "5"
- "5.1"
- "4"
- "4.2"
- "4.1"
- "4.0"
- "0.12"
- "0.11"
@nukosuke
nukosuke / file0.txt
Created May 5, 2016
Vue.jsとanimete.cssでアニメーション ref: http://qiita.com/nukosuke/items/548dbee9cc715e5dfb32
View file0.txt
$ npm install vue vue-router --save
@nukosuke
nukosuke / file0.txt
Last active May 26, 2016
Sequelize + bcrypt でパスワード認証を実装する ref: http://qiita.com/nukosuke/items/ab492a425b0611abf788
View file0.txt
$ npm i sequelize --save
@nukosuke
nukosuke / article-model-create.sh
Last active May 28, 2016
model create command for loq
View article-model-create.sh
$(npm bin)/sequelize model:create \
--name Article \
--attributes 'user_id:number, published:bool, tag_id:number, year:number, month:number, day:number, slug:string, title:string, body_markdown:text, body_html:text'
@nukosuke
nukosuke / load-dir-as-PascalCase.js
Created May 29, 2016
ディレクトリ内のモジュールをパスカルケースでエクスポートする。
View load-dir-as-PascalCase.js
'use strict';
module.exports = function(dirname) {
var modules = {};
require('fs').readdirSync(dirname + '/').forEach(file => {
if (file.match(/\.js$/) !== null && file !== 'index.js') {
var name = file
.replace('.js', '')
.split('-')
@nukosuke
nukosuke / api-client.js
Created May 30, 2016
REPLで作ったハリボテAPIクライアント
View api-client.js
'use strict';
var http = require('http');
module.exports = class ApiClient {
constructor(host, port) {
this.host = host;
this.port = port;
}
setHost(host) {
View http-schema-completion.js
if (!/^http[s]?\:\/\//.test(url)) {
url = 'http://' + url;
}
@nukosuke
nukosuke / mailer-middleware.js
Created Jun 2, 2016
nodemailerでメール送信を実装する
View mailer-middleware.js
'use strict';
var Middleware = require('./middleware');
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var nodemailer = require('nodemailer');
var smtpPool = require('nodemailer-smtp-pool');
var EmailTemplate = require('email-templates').EmailTemplate;
/**