Skip to content

Instantly share code, notes, and snippets.

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

HaiTo HaiTo

🏠
Working from home
View GitHub Profile
@HaiTo
HaiTo / index.html
Created February 14, 2018 06:55
指定したBucketに存在するObjectを列挙する為のあれこれ
<!DOCTYPE html>
<html>
<head>
<title>osyare</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.194.0/aws-sdk.min.js"></script>
<script
src="http://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E="
crossorigin="anonymous"></script>
<script type="module">
@HaiTo
HaiTo / hurman_readable_item.rb
Created February 5, 2018 09:18
実際やさしい
class Object
def 借方
:dr
end
alias 左 借方
def 貸方
:cr
end
alias 右 貸方
end
@HaiTo
HaiTo / app__commands__follow_command.rb
Last active February 4, 2018 08:19
何とも言えない設計
class FollowCommand
def initialize(user, params)
@user = user
@params = params
end
using UserCommand::Follow
def execute!
user = User.find(@params[:id])
User.transaction do
@HaiTo
HaiTo / 5_xx.hs
Created August 23, 2017 11:07
5_xx.hs
data Queue a = DeQue [a] [a] deriving (Show)
head' :: Queue a -> a
head' (DeQue (x:_) _) = x
checkf :: [a] -> [a] -> Queue a
checkf [] r = DeQue (reverse r) []
checkf l r = DeQue l r
tail' :: Queue a -> Queue a
javascript:(function(d){function l(){(function($){
var i, t, a, tw, img_src, track_range;
var s = function(i){
var e = document.getElementById(i).innerHTML;
return e
.replace(/&amp;/g, "%26")
.replace(/&lt;/g, "%3c")
.replace(/&gt;/g, "%3e");
};
t = s("currently-playing-title");
@HaiTo
HaiTo / today.go
Last active December 28, 2016 04:26
package main
import (
"fmt"
homedir "github.com/mitchellh/go-homedir"
"os"
"time"
)
func main() {
/*
* !!!!!!! this css is not maintenance !!!!!!!!
* !!! the maintenanceing css are -> https://github.com/HaiTo/usefull_facebook_at_work !!!
*/
#globalContainer {
width: calc( 100% - 300px) !important;
min-width: 1014px;
}
#contentArea {
width: calc( 100% - 40px ) !important;
# OK
age = case
when condition
p 'hoge'
end
# OK
piyo =
case
when condition
@HaiTo
HaiTo / pivot_logging.rb
Last active April 5, 2018 04:29
FaradayのリクエストのHashの特定のキーだけを抜き取ってLoggingするぞい。
require 'faraday'
require 'faraday_middleware'
require 'logger'
require 'pry-byebug'
module Faraday
class PivotLogging < Faraday::Middleware
# @param options [Hash] {logger: Rails::Logger.new, call_logging: 'info', pivot: pivot}
def initialize(app, options ={})
super(app)
@HaiTo
HaiTo / mecab.md
Last active August 29, 2015 14:13
MeCab with UniDic

形態素解析が難しいのにはなのはのほかにはがないとかがをられとかがありこれらははにはにやけよりなからの伝統だそうです

$ mecab  
形態素解析が難しいのにはなのはのほかにはがないとかがをられとかがありこれらははにはにやけよりなからの伝統だそうです  
形態	ケータイ	ケイタイ	形態	名詞-普通名詞-一般  
素	ソ	ソ	素	接尾辞-名詞的-一般  
解析	カイセキ	カイセキ	解析	名詞-普通名詞-サ変可能  
が	ガ	ガ	が	助詞-格助詞  
難しい	ムズカシー	ムズカシイ	難しい	形容詞-一般	形容詞	連体形-一般