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
/* nghttp2_on_frame_recv_callback: Called when nghttp2 library | |
received a complete frame from the remote peer. */ | |
static int on_frame_recv_callback(nghttp2_session *session, | |
const nghttp2_frame *frame, void *user_data) { | |
std::cout << "RECV:: "; | |
switch (frame->hd.type) { | |
case NGHTTP2_DATA: | |
std::cout << "NGHTTP2_DATA" << std::endl; | |
break; |
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
#!/usr/bin/env ruby | |
# TODO (temporary here, we'll move this into the Github issues once | |
# redis-trib initial implementation is completed). | |
# | |
# - Make sure that if the rehashing fails in the middle redis-trib will try | |
# to recover. | |
# - When redis-trib performs a cluster check, if it detects a slot move in | |
# progress it should prompt the user to continue the move from where it | |
# stopped. |
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 execFile = require("child_process").execFile, | |
page = require('webpage').create(), | |
system = require('system'), | |
workdir = null, | |
knownUrls = [], | |
files = [] | |
; | |
function safeExit(exitCode) { | |
if (workdir) |
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
+ log_format combined2 '$remote_addr - $remote_user [$time_local] ' | |
+ '"$request" $status $body_bytes_sent ' | |
+ '"$http_referer" "$http_user_agent" $ssl_client_verify'; | |
+ access_log /dev/stdout combined2; | |
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
kbd106.dll を用意する。 | |
Win8 だとビルドできたが 10 ではできなかったので | |
http://www.codeproject.com/Articles/439275/Loading-keyboard-layout-KbdLayerDescriptor-in | |
で C:\Windows\system32\kbd106.dll をロードし、好みの状態になるようにバイナリエディタで書き換える -- | |
syswow にもあるが、OS は system32 のほうを使っている、ビット長が違うこともあり、中身は異なるので注意。 | |
win 10 だと 0xD70 あたりからが数字キー | |
変換、無変換はキーがテーブルになかったため、 scancode -> VK 変換のテーブル (0xA80-0xC20) をいじって 変換 | |
(0x79): 0x041C -> OEM8(0xDF), 無変換(0x7b):0x041D -> 7(0x0037) | |
に読み替え、未使用だった OEM8 をすべて _ にしている |
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 arrayMethods = Object.getOwnPropertyNames( Array.prototype ); | |
arrayMethods.forEach( attachArrayMethodsToNodeList ); | |
function attachArrayMethodsToNodeList(methodName) | |
{ | |
if(methodName !== "length") { | |
NodeList.prototype[methodName] = Array.prototype[methodName]; | |
} | |
}; |
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
# deploy.rb | |
def retrieve_instances(name_prefix) | |
require 'aws-sdk' | |
next_token = nil | |
dns_list = [] | |
begin | |
resp = Aws::EC2::Client.new.describe_instances( | |
filters: [{name: "tag:private:service", values: ['my-service']}], | |
next_token: next_token) | |
resp.reservations.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
if Rails.env.development? | |
class DisableAssetsLogger | |
def initialize(app) | |
@app = app | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
end | |
def call(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 |
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
git bisect start -- first_bad success success ... | |
git bisect run test command |
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 ClockRadio | |
on = self.instance_method(:on!) | |
define_method(:on!) do | |
on.bind(self).call | |
@display_time = true | |
end | |
def display_time? | |
@display_time |