Skip to content

Instantly share code, notes, and snippets.

View yoshiori's full-sized avatar
🏠
Working from home

Yoshiori Shoji yoshiori

🏠
Working from home
View GitHub Profile
public enum Hoge implements Runnable{
FOO("foo"){
@Override
public void run() {
// 何か処理
}
@Override
public String getAddress() {
@yoshiori
yoshiori / nature-remo.1m.rb
Created December 21, 2020 11:01
不快指数だすやつ
#!/usr/bin/env ruby
require "uri"
require "net/http"
require "json"
token = "xxxx" # https://home.nature.global/
uri = URI.parse("https://api.nature.global/1/devices")
http = Net::HTTP.new(uri.host, uri.port)
@yoshiori
yoshiori / ignore
Created June 8, 2020 11:05
.config/git/ignore
# Mac
.DS_Store
.AppleDouble
.LSOverride
Icon
# IntelliJ
.idea/
**/*.iml

この修正を入れる前の実装で中身見てみた。元の hourly の実装時の数値

[1] pry(#<RSpec::ExampleGroups::DailyGoalAllocatorImpression::Allocate::WhenCampaignPeriodStartIsNotMidnight>)> daily_goals.map{|g| g.allocated }
=> [41153, 165536, 149422, 133308, 117194, 101080, 84966, 68852]
[2] pry(#<RSpec::ExampleGroups::DailyGoalAllocatorImpression::Allocate::WhenCampaignPeriodStartIsNotMidnight>)> reference_time
=> Thu, 24 Oct 2019 10:00:00 JST +09:00

時間が 10 時だから初日の allocate が一番少なくなっているように見えるようになっているだけに見えるので調査

@yoshiori
yoshiori / coderwall.html
Created July 12, 2012 07:54
octopress coderwall badges
{% if site.coderwall_user %}
<section class="well">
<ul class="nav">
<li class="nav-header">Coderwall Badges</li>
</ul>
<div id="coderwall_badges"></div>
<a href="http://coderwall.com/{{site.coderwall_user}}">@{{site.coderwall_user}}</a> on coderwall
<script type="text/javascript">
$(document).ready(function(){
$.getJSON("http://coderwall.com/{{site.coderwall_user}}.json?callback=?", function(data){
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class Scripting {
public static void main(String[] args) throws Exception{
ScriptEngine engin = new ScriptEngineManager().getEngineByName("JavaScript");
engin.eval("print(\"Hello JavaScript!!\");");
}
group :test, :development do
gem 'rspec-rails'
gem 'guard'
gem 'guard-rspec'
gem 'growl', :require => false # for Mac
gem 'libnotify', :require => false # for *nix
end
@yoshiori
yoshiori / yomikata.rb
Created July 25, 2012 11:08
$ruby yomikata.rb 2 yomikata シーサーフ
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'net/http'
def increment(word,pronounce)
http = Net::HTTP.new('yomikata.org')
response = http.post('/ajax/vote.php', "pronounce=#{pronounce}&word=#{word}", 'User-Agent' => 'yoshiori@gmail.com')
puts "increment #{pronounce}/#{word}"
end
@yoshiori
yoshiori / logback.xml
Created June 27, 2012 04:58
turboFilter marker sample
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>MarkerExample</Marker>
<OnMatch>DENY</OnMatch>
</turboFilter>