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
ja: | |
errors: | |
messages: | |
invalid_date: "は不正な日付です。" | |
invalid_time: "は不正な時間です。" | |
invalid_datetime: "は不正な日時です。" | |
is_at: "は%{restriction}にしてください。" | |
before: "は%{restriction}より前にしてください。" | |
on_or_before: 'は%{restriction}以前にしてください。' | |
after: "は%{restriction}より後にしてください。" |
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/sh | |
# | |
# redis init file for starting up the redis daemon | |
# | |
# chkconfig: - 20 80 | |
# description: Starts and stops the redis daemon. | |
# Source function library. | |
. /etc/rc.d/init.d/functions |
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
!!! 5 | |
html(lang='en') | |
head | |
meta(charset='utf-8') | |
title Bootstrap, from Twitter | |
meta(name='viewport', content='width=device-width, initial-scale=1.0') | |
meta(name='description', content='') | |
meta(name='author', content='') | |
// Le styles | |
link(href='../assets/css/bootstrap.css', rel='stylesheet') |
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
# https://raw.github.com/github/gitignore/master/Global/OSX.gitignore | |
.DS_Store | |
.AppleDouble | |
.LSOverride | |
Icon | |
# Thumbnails | |
._* |
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
// 全角スペースがある場合は半角スペースに置換されます | |
trim: function(string, callback){ | |
var callbackExists = false; | |
if (callback && typeof(callback) === 'function') callbackExists = true; | |
try { | |
string = string.replace(/ /g, ' ').replace(/(^\s+)|(\s+$)/g, ""); | |
if (callbackExists) callback(null, string); | |
else return string; | |
} catch (e) { |
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
var str_created_at = 'Sun Dec 11 21:44:28 +0000 2011'; | |
var created_at = new Date(str_created_at); | |
console.log(created_at) | |
// Mon Dec 12 2011 06:44:28 GMT+0900 (JST) | |
function toUTCDatetime (date, callback) { | |
try { | |
var result = date.getUTCFullYear() + "-" + date.getUTCMonth() + "-" + date.getUTCDate() + " " + date.getUTCHours() + ":" + date.getUTCMinutes() + ":" + date.getUTCSeconds(); | |
callback(null, result); | |
} catch (err) { |
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 utils; | |
/** | |
* @author Musubu Inc. | |
*/ | |
public class StringUtils { | |
private static final String SPACE_CHAR_HALF = " "; | |
private static final String SPACE_CHAR_WIDE = " "; | |
/** |
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
s = s.replaceAll("/$", ""); | |
// or | |
s = s.replaceAll("/\\z", ""); | |
// slightly faster | |
if (s.endsWith("/")) { | |
s = s.substring(0, s.length() - 1); |
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 utils; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.Enumeration; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipFile; |
NewerOlder