第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 'formula' | |
class Emacs < Formula | |
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.4.tar.bz2' | |
md5 '070c68ad8e3c31fb3cb2414feaf5e6f0' | |
homepage 'http://www.gnu.org/software/emacs/' | |
if ARGV.include? "--use-git-head" | |
head 'git://git.sv.gnu.org/emacs.git' | |
else |
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"); |