第1回meetupによせて
初めましての方もそうでない方もこんばんは。
合同会社qumuあらため合同会社テンマド(10mado, LLC)の山岡(@hiro_y)です。
この中にフリーランスの方、どれぐらいいらっしゃるでしょうか。 また、例えば就業後とか週末とか、自宅じゃない作業場所がほしい人は?
| ##controller | |
| def index | |
| #includesとかはせずにとりあえずn1_safeを付けておく | |
| @posts = Post.all.n1_safe | |
| end | |
| #Post load (X.Xms) SELECT "posts".* FROM "posts" | |
| ##view | |
| #なにも考えずにeachとかまわしまくると、必要になった時にまとめてN+1を回避しつつloadされる感じ | |
| <% @posts.each do |post| %> |
| begin | |
| require 'hirb' | |
| rescue LoadError | |
| # Missing goodies, bummer | |
| end | |
| if defined? Hirb | |
| # Dirty hack to support in-session Hirb.disable/enable | |
| Hirb::View.instance_eval do | |
| def enable_output_method |
| require 'sass/plugin' | |
| module Sass | |
| module Rails | |
| class TemplateHandler | |
| class_attribute :default_format | |
| self.default_format = Mime::CSS | |
| def initialize | |
| end |
| class ActiveRecord::Base | |
| # Usage: | |
| # | |
| # > puts User.first.to_factory_girl | |
| # FactoryGirl.define do | |
| # factory :user do | |
| # ... | |
| # end | |
| # end | |
| # # Usage: FactoryGirl.create(:user, ...) |
miyagawa naoyaさん、最近は結構ブログが活発になってきている感じですね。
naoya はいはい、そうですよね。
miyagawa なんか、心境の変化があったんですか。
naoya 心境の変化(笑)
miyagawa (笑)
naoya いやずっとドラクエしかしてなかったんですけど(笑)
Olivier Lacan, Tony Winn
Nobuyoshi Nakada showed a beautifully simple way to start a web server within the present working directory by only using Ruby. ruby -run -e httpd . -p 5000
ruby.ruby -run -e httpd . -p 5000. That will start the server using WEBrick, which comes with(?) the Ruby Standard Library, and you can see the server running at localhost:5000 in your brouser(?), if you have an index.html file in that directory, it will show up in your browser.| url: | |
| 'https://username:password@github.com/username/foo-bar-baz.git' | |
| // ==UserScript== | |
| // @name http://gazoreply.jp/ | |
| // @description replace gazoreply.jp copy image url | |
| // @include http://gazoreply.jp/* | |
| // @exclude http://gazoreply.jp/situation/* | |
| // ==/UserScript== | |
| window.addEventListener('load', function(){ | |
| var imgURL = document.getElementById("main-photo-img").getAttribute('src'); | |
| var clipboardButtonElement = document.getElementById("copy-clipboard-btn"); |