Skip to content

Instantly share code, notes, and snippets.

View atty303's full-sized avatar

Koji AGAWA atty303

View GitHub Profile
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Foundation/Foundation.h>
@atty303
atty303 / .gitignore
Created May 31, 2011 07:42
Initial gitignore for iOS project.
# xcode noise
build/*
*.perspective
*.perspectivev3
*.pbxuser
*.xcworkspace
*.mode1
*.mode2v3
*.mode1v3
xcuserdata
@atty303
atty303 / gist:7261749
Last active December 27, 2015 03:48
iTerm2 + AquaSKK

iTerm2 + AquaSKK

AquaSKK を素の iTerm2 で使うと、IM 状態を変更するための "C-j" や "l" がそのまま入力されてしまって不便という問題があり、 以下のあたりでその問題を直すパッチを作ってくださった方がおりました。

僕も 1.0.0 が出たころに上記パッチを当てた iTerm2 をずっと使ってました。

# -*- coding: utf-8; -*-
import sys
class Solver(object):
def __init__(self, items):
self.nb_items = len(items)
self.sorted_items = sorted(items)
sudo service td-agent start
Starting td-agent: /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate fluent-plugin-s3-0.4.1, because fluent-mixin-config-placeholders-0.3.0 conflicts with fluent-mixin-config-placeholders (~> 0.2.0) (Gem::LoadError)
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/specification.rb:746:in `activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems.rb:212:in `rescue in try_activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems.rb:209:in `try_activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /etc/td-agent/plugin/out_s3_dap.rb:1:in `<top (required)>'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
$ sudo /etc/init.d/td-agent start
Starting td-agent: /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate fluent-plugin-s3-0.4.1, because fluent-mixin-config-placeholders-0.3.0 conflicts with fluent-mixin-config-placeholders (~> 0.2.0) (Gem::LoadError)
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/specification.rb:746:in `activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems.rb:212:in `rescue in try_activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems.rb:209:in `try_activate'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /etc/td-agent/plugin/out_b.rb:1:in `<top (required)>'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib64/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
package org.apache.spark.streaming
import org.apache.spark.util.ManualClock
/**
* A `Clock` whose time can be manually set and modified. Its reported time does not change
* as time elapses, but only as its time is modified by callers. This is mainly useful for
* testing.
*
* private[spark] である ManualClock を外から扱えるようにする proxy class.
package com.adtdp.tenma.shared.spark.app
import scala.util.Try
/**
* Spark アプリケーションを表現する trait
*/
trait SparkApp {
/**
* アプリケーションのエントリポイント
@atty303
atty303 / README.md
Created November 10, 2016 09:11
Promethes & Grafana - Quick Start

手元で素早く Prometheus & Grafana を立ち上げます。 Grafana への DataSource 登録も自動でやるので、すぐに使えます。 Prometheus Exporter の出力の確認にどうぞ。

起動

$ docker-compose up -d
Creating network "ezprometheus_default" with the default driver
Creating ezprometheus_prometheus_1