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 * as log from 'loglevel' | |
export default class JobQueue { | |
constructor (name, options) { | |
this._name = name | |
this._queue = [] | |
this._running = false | |
this._options = Object.assign({ interval: 1000 }, options) | |
} |
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
--- compat.py.bk 2016-03-10 07:43:01.000000000 +0900 | |
+++ compat.py 2016-03-10 07:45:42.000000000 +0900 | |
@@ -29,7 +29,9 @@ def supported_docker_installed(): | |
""" | |
try: | |
- return commands.version() >= SUPPORTED_DOCKER_V | |
+ # return commands.version() >= SUPPORTED_DOCKER_V | |
+ from distutils.version import LooseVersion | |
+ return LooseVersion(commands.version()) >= LooseVersion(SUPPORTED_DOCKER_V) |
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
class StopWatch | |
def start | |
@start_time ||= Time.now | |
@stop_time = nil | |
self | |
end | |
def stop | |
@stop_time = Time.now | |
self |
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 "Timer.h" | |
NSDate *startDate; | |
NSDate *endDate; | |
@implementation Timer | |
- (id)initWithStart { | |
self = [super init]; | |
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
require 'roo' | |
s = Roo::Excelx.new('test.xlsx') | |
s.default_sheet = s.sheets[0] | |
columns = ('A'..'Z') | |
rows = (1..10) | |
columns.each do |c| | |
rows.each do |r| |
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
require 'mustache' | |
str = <<-EOT | |
a | |
b | |
c | |
EOT | |
lines = [] | |
str.each_line do |line| |
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 java.io.IOException; | |
import java.net.DatagramPacket; | |
import java.net.InetAddress; | |
import java.net.MulticastSocket; | |
/** | |
* マルチキャスト通信検証用 | |
* 各ホストでjarを起動してマルチキャスト通信が可能か検証する。 | |
* $ java -jar multicast.jar [message] | |
*/ |
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
public final class CodePointUtils { | |
private CodePointUtils() { | |
} | |
/** | |
* 文字列中のサロゲートペア文字を全て置換文字列に置換. | |
* | |
* @param str 文字列 | |
* @param replacement 置換文字列 | |
* @return 置換後文字列 |
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 -e | |
cd `dirname $0` | |
DEBUG={$DEBUG:-0} | |
SCRIPT_HOME=`pwd` | |
LOG_DIR=$SCRIPT_HOME/log | |
LOG_FILE_NAME=`basename $0 .sh`-`date +"%Y%m%d"`.log | |
LOG_FILE=$LOG_DIR/$LOG_FILE_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
from Crypto.Cipher import AES | |
import base64 | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] | |
class AESCipher: | |
def __init__(self, key): | |
self.key = key |
NewerOlder