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
package quickstart | |
import xitrum.Server | |
object Boot { | |
def main(args: Array[String]) { | |
Server.start() | |
Server.stopAtShutdown() | |
} | |
} |
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
// Save excel friendly csv for Mac/Windows. | |
// See also | |
// http://qiita.com/bump_of_kiharu/items/f41beec668e1f3ea675e#%E5%8F%82%E8%80%83 | |
// https://stackoverflow.com/questions/17879198/adding-utf-8-bom-to-string-blob | |
const UTF16BOM = '\ufeff'; | |
const isIE = false || !!document.documentMode; | |
const isEdge = navigator && /Edge\/\d./i.test(navigator.userAgent); |
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
const recursivify = (api, params, accumurator, condition) => { | |
const exec = (acc) => { | |
return new Promise((resolve, reject) => { | |
api(params, resolve, reject); | |
}) | |
.then((v) => { | |
return Promise.resolve(accumurator(acc, v)); | |
}, | |
() => { | |
return Promise.resolve(acc); |
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
import encoding from 'encoding-japanese'; | |
import json2csv from 'json2csv'; | |
let json = [{"text": "日本語"}, {"text": "改行\n改行"}] | |
function saveCsvAsFile(text, filename) { | |
const UTF16BOM = '\ufffe'; | |
const isWindows = navigator.platform.indexOf("Win") !== -1; | |
function isLittleEndian(){ |
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-compat'; | |
import StyleSheet from 'react-style'; | |
import React from 'react'; | |
import {FontIcon, IconButton, Paper} from 'material-ui'; | |
import {Tabs} from 'react-draggable-tab'; | |
import {COLORS} from '../themes/CommonStyle'; | |
import ClearFix from '../common/ClearFix'; |
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
rm -rf ~/.atom/storage/* |
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
#!/bin/bash | |
curator --host localhost close indices --prefix logstash --older-than 30 --time-unit days --timestring %Y.%m.%d | |
curator --host localhost delete indices --prefix logstash --older-than 60 --time-unit days --timestring %Y.%m.%d | |
curator --host localhost bloom indices --prefix logstash --older-than 2 --time-unit days --timestring %Y.%m.%d |
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
package quickstart.action | |
import scala.concurrent._ | |
import io.netty.channel.{ChannelFuture, ChannelFutureListener} | |
import xitrum.{Action, ActorAction, FutureAction, Config} | |
import xitrum.annotation.GET | |
import xitrum.etag.NotModified |
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
let success = (value) => { | |
console.log('success', value) | |
} | |
let fail = (value) => { | |
console.log('fail', value) | |
} | |
let action = (name) => { | |
return new Promise((resolve, reject) => { |
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 React from 'react/addons'; | |
const IS_FORM_SUPPORTED = (() => {return window.FormData !== undefined; })(); | |
const UPLOAD_ACTION = '/api/fileupload'; | |
const styles = { | |
label: { | |
display: 'block', |