Skip to content

Instantly share code, notes, and snippets.

ujihisa

Block or report user

Report or block ujihisa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View quora-chat-background.md

家族などでのプライベートな会話を想定しています。

  • 自分の全発言を検索できて (つまりSlackの個人アカウントのようにログ保存上限件数が決まっているもの以外)
  • 日本語の漢字変換ができて (つまりFacebook MessengerやTwitter以外で)
  • マルチプラットフォームで (web/iOS/Android)
  • 電話を必須とせず (つまりwhatsappやtwitter以外で)
  • emojiを入力でき (つまりDiscord以外で)
  • サービス終了が予告されていない (つまりGoogle Hangouts以外で)
  • 写真をアップロードできる
View 7-days-to-die-attributes-ja.md
  • Perception (遠距離攻撃のみ。黒魔道士系)

    • rifle, spear, (rocket launcher, grenade)
      • 近距離攻撃が弱く、防御も弱いので、敵に近づかれると即アウト
    • animal tracker (食糧問題解決)
    • lucky looter (探索のボーナスup)
      • PER単体だと探索自体は困難
    • salvage operations (レンチ++)
  • Strength (近距離攻撃系、ただし防御低め)

    • shotgun, club, sledgehammer
View gist:cf564b4f97c2bfda2a3858b36e0a239a
https://www.nenkin.go.jp/shinsei/kokunen.html
https://www.nenkin.go.jp/shinsei/kokunen.files/654-1credit.pdf
View gorilla-grep.vim
function! s:flatten(xss) abort
let memo = []
for xs in a:xss
for x in xs
call add(memo, x)
endfor
endfor
return memo
endfunction
View caller_locations-with-columns.patch
$ d
diff --git a/vm_backtrace.c b/vm_backtrace.c
index bb01983a7c..de7b961174 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -47,6 +47,28 @@ calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
return rb_iseq_line_no(iseq, pos);
}
+inline static int
View rubykaigi2019-ujihisa-play-with-local-vars.md

Play with local vars

While waiting for my talk, guess what does it output without actually running it.

View put_in.rb
def put_in_f(hash, keys, value)
if keys.empty?
value
else
car, cdr = [keys[0], keys[1..]]
hash.merge(car => put_in_f(hash[car], cdr, value))
end
end
def extract(binding, ast)
View wordcount.vim
let s:S = vital#vital#import('Data.String')
let s:L = vital#vital#import('Data.List')
function! s:count_words(text) abort
let F = { memo, x -> has_key(memo, x)
\ ? extend(memo, {x: memo[x] + 1})
\ : extend(memo, {x: 1})}
return s:L.foldl(F, {}, s:S.scan(a:text, '\w\+'))
endfunction
View asakusa.rb
def give_ujihisa_money(users, value)
# users[:ujihisa][:money] = 24
update_in2(-> { users[:ujihisa][:money] }, 24)
# put_in(users[:ujihisa][:money], 24)
# dig <-> bury
end
def update_in2(f, value)
pp RubyVM::InstructionSequence.of(f).to_a
nil
View wip.rb
#!ruby -v
ALL_PERKS = {
PER: ['Gunslinger', 'Shotgun Messiah', 'Automatic Weapons', 'Dead Eye', 'Archery', 'Explosive Weapons', 'Boom! Headshot!', 'Run And Gun', 'Lucky Looter', 'Salvage Operations'],
STR: ['Wrecking Crew', 'Sexual Tyrannosaurus', 'Flurry of Blows', 'Deep Cuts', 'Stay Down!', 'Heavy Metal', 'Skull Crusher', 'Miner 69\'er', 'Pack Mule', 'Mother Lode'],
FRT: ['Heavy Armor', 'The Huntsman', 'Intrinsic Immunity', 'Well Insulated', 'Living Off The Land', 'Pain Tolerance', 'Healing Factor', 'Fully Hydrated', 'Slow Metabolism', 'Self Medicated'],
AGI: ['Rule 1: Cardio', 'Light Armor', 'Charging Bull', 'Parkour', 'Olympic Swimmer', 'Ninja Movement', 'Hidden Strike', 'From Shadows'],
INT: ['Better Barter', 'The Daring Adventurer', 'Charismatic Nature', 'Hammer & Forge', 'Grease Monkey', 'Advanced Engineering', 'Yeah, Science!', 'Physician', 'Master Chef']
}
You can’t perform that action at this time.