2016年10月17日のブックマーク (6件)

  • How to generate a random string in Ruby

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives

    How to generate a random string in Ruby
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    “random_string = SecureRandom.hex”
  • React JSX: selecting "selected" on selected <select> option

    In a React component for a <select> menu, I need to set the selected attribute on the option that reflects the application state. In render(), the optionState is passed from the state owner to the SortMenu component. The option values are passed in as props from JSON. render: function() { var options = [], optionState = this.props.optionState; this.props.options.forEach(function(option) { var sele

    React JSX: selecting "selected" on selected <select> option
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    “However, React makes this even easier for you. Instead of defining selected on each option, you can (and should) simply write value={optionsState} on the select tag itself:”
  • How get integer value from a enum in Rails?

    I have a enum in my Model that corresponds to column in the database. The enum looks like: enum sale_info: { plan_1: 1, plan_2: 2, plan_3: 3, plan_4: 4, plan_5: 5 } How can I get the integer value? I've tried Model.sale_info.to_i But this only returns 0.

    How get integer value from a enum in Rails?
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    “You can get the integer values for an enum from the class the enum is on: Model.sale_infos # Pluralized version of the enum attribute name That returns a hash like: { "plan_1" => 1, "plan_2" => 2 ... } You can then use the sale_info value from an instance of the Model class to access the integer
  • 会社員には「長時間労働をする自由」など必要ない - 脱社畜ブログ

    電通の過労死事件を受けて、長時間労働についての議論がいま盛んになってきている。そんな流れの中、こちらの記事を読んだ。 www.outward-matrix.com 「長時間労働の是非」について議論をしていると、このように「残業をしたくてしている人の自由まで奪うのはおかしい」という意見がほぼ必ずと言ってよいほど出てくる。理屈としては理解できない部分もないわけではないのだけど、残念ながらこの意見には賛成できない。 この手の意見を要約するなら「長時間働きたい人には長時間働く自由を与えて、残業したくない人は残業しない自由を与える。自分の意志で自由に働き方を選べるようにすべきだ」といった感じになるかと思う。なるほど、たしかに自分の意志が最大限尊重されるという点ではかなり良さそうだ。しかし、当にそんなことは可能なのだろうか? まず第一に、「自分の意志」を外から推し量ることの難しさを考慮する必要がある

    会社員には「長時間労働をする自由」など必要ない - 脱社畜ブログ
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    そうそう、この部分。適切な制約こそ人を自由にするの。だって中世より法整備の整った現代のほうが明らかに人権が尊重されてるでしょう。“1日16時間働きたいという長時間労働を前提とする人間と、1日8時間で定時帰宅
  • outward-matrix.com - outward matrix リソースおよび情報

    This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.

    outward-matrix.com - outward matrix リソースおよび情報
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    “しかし、電通の事件や他にも数多ある労働者関連の問題の本質に目を向けず、「長時間労働撲滅」というわかりやすいフレーズで大衆をあおるやり方が、ぼくには気持ち悪く感じられます。 ”
  • プログラマーが天職だと思っている

    というか、エンジニア以外ができる気がしない 別にプログラミングが超楽しいわけではない プログラマーはつっけんどんにマジレスする 他の職種なら「思ってても言っちゃダメだろ」みたいなことでも割りと言う クソなものに対しクソですよねってある程度は言える そういうの気にしなくていいの助かる プログラマーにおべっかは必要ない 「俺技術者だぞ」みたいな雰囲気出しておけば、相手のご機嫌伺ったりする必要はあまりない めっちゃ助かる プログラマーは我儘だ 我儘にしないと完成しないから、我儘でもなんとか許されている 他の職種じゃこうはいかない プログラマーの始業は遅い 早くて9時、遅くて10時、前職は11時だった 夜型が多いからだと思う 電車空くし助かる プログラマーはよく遅刻をする IT業界の遅刻率はかなり高いと思う 夜型人間が多いんだろう でもそこまで重大な問題にならないケースが多いし 10時始業で9時5

    プログラマーが天職だと思っている
    kent-where-the-light-is
    kent-where-the-light-is 2016/10/17
    “要はプログラマーは仕事さえキチンとこなせば他はおまけという雰囲気があるよねって言いたかった(おまけ=「社会人って学生より大変だよ」って先輩から脅されるような部分)その、おまけの部分を重視されるような