Just click here
View linebottest.py
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
# -*- coding: utf-8 -*- | |
from flask import Flask, request | |
import json | |
import os | |
import requests | |
app = Flask('__main__') |
View color.rb
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 | |
def colorcodeaverage(*codes) | |
sum = [ 0, 0, 0 ] | |
codes.each do |code| | |
c = code.scan(/.{1,2}/) | |
sum = sum.map.with_index { |s,i| s + c[i].to_i(16) } | |
end | |
sum.map { |s| ( s / codes.size ).to_s(16).rjust(2,'0') }.join.upcase | |
end |
View hoge.py
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 Hoge: | |
def hage(self): | |
if not '_hage' in self.__dict__.keys(): | |
self._hage = 'hage' | |
return self._hage | |
hoge = Hoge() | |
print hoge.hage() |
View vali.rb
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
params = { v1: '10', v2: '' } | |
rule1 = Focuslight::Validator.rule(:int) | |
rule2 = Focuslight::Validator.rule(:not_blank) | |
result = Focuslight::Validator.validate( | |
params, | |
v1: { rule: [ rule1, rule2 ] }, | |
v2: { rule: [ rule1, rule2 ] }, | |
) | |
ap result |
View app.rb
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 'sinatra/base' | |
require 'sinatra/namespace' | |
class App < Sinatra::Base | |
end |
View app.rb
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 App < Sinatra::Base | |
configure do | |
use Rack::Session::Dalli, | |
cache: Dalli::Client.new( | |
"#{ENV['MEMCACHE_SERVER']}:#{ENV['MEMCACHE_PORT']}", | |
username: ENV['MEMCACHE_USERNAME'], | |
password: ENV['MEMCACHE_PASSWORD'] | |
) | |
end | |
end |
View 0_app.rb
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 'sinatra/base' | |
class Main < Sinatra::Base | |
before do | |
# nanka | |
end | |
get '/' do | |
'index' | |
end |
View hf_embed.md
2パターン書いてみたのですが、どちらがよい(or どちらもだめ)でしょうか??
graphonly
graphonly=1
を指定すると、グラフのヘッダが消えるように実装しました
https://github.com/studio3104/HRForecast/commit/8621c50c6efe6f47f85cd8f1d11675880c2b28a6
graphonly=1
View simple_dstat-td-agent.conf
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
# key の構成は変わってしまうけど td-agent.conf としてはこっちのほうがシンプル | |
<source> | |
type dstat | |
tag dstat.__HOSTNAME__ | |
option -lnc | |
delay 3 | |
</source> | |
<match dstat.**> |
NewerOlder