This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function requestIDMiddleware(next, params) { | |
var requestID = 'hogehoge'; | |
if(next) next({ | |
requestID: requestID | |
}); | |
} | |
function sessionMiddleware(next, params) { | |
var session = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'oauth2' | |
require 'sinatra' | |
require 'faraday' | |
OAuth2::Response.register_parser(:text, 'text/plain') do |body| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import request from 'superagent'; | |
import _ from 'lodash'; | |
import URL from 'url'; | |
import Promise from 'bluebird'; | |
const global = Function("return this")(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import Subject from 'models/BaseModel'; | |
import assert from 'assert'; | |
import sinon from 'sinon'; | |
import _ from 'lodash'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import _ from 'lodash'; | |
import Request from 'superagent'; | |
import Promise from 'bluebird'; | |
class I18n { | |
load(path) { | |
return new Promise((f, r) => { | |
Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import _ from 'lodash'; | |
import is from 'is_js'; | |
import { parseIntOrNull } from 'services/NumberUtils'; | |
class BaseModel { | |
static hasMany(name, targetClass, defaultID) { | |
/* eslint complexity: [0, 6] */ | |
if (!this.prototype[`_get_${name}`]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh [host] | |
cd ~ | |
mkdir -p ws | |
cd ws | |
wget --no-check-certificate --page-requisites --convert-links [host][path][page].html # .htmlでredirectをさける | |
cd [host][path] | |
mv [page].html [documentRoot][path]/ | |
cd [documentRoot][path] | |
# ここでブラウザで確認 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'fluent-logger' | |
require 'active_support/core_ext' | |
module CreativeSurvey | |
class FluentLogger < ::Logger | |
attr_reader :config_file | |
def initialize(config_file = Rails.root.join('config', 'fluent-logger.yml.erb'), device = nil) | |
@config_file = config_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'fluent-logger' | |
require 'active_support/core_ext' | |
require 'forwardable' | |
module Mosson | |
module FluentLogger | |
module ModuleMethods | |
def new(file = Rails.root.join("config", "fluent-logger.yml.erb")) | |
ActiveSupport::TaggedLogging.new(logger(file)) |
NewerOlder