You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
ãã®è¨äºã¯ feedforce Advent Calendar 2016 - Adventar ã®2æ¥ç®ã®è¨äºã§ãã 1æ¥ç®ã¯ æºç¾©çµã®ã·ã³ãã«ãªèãæ¹ã好ã - Marketing book ã§ãããè¯ã話ã ã(ã¡ãªã¿ã«å¤§æ²³ãã©ããå¹³æ¸ çã ã£ãå¹´ã¯ãæã家ã§ã¯å¾ç½æ²³é¢ã®è©ä¾¡ãé«ãã£ãã§ããæãããã) RubyCriticã®ãç´¹ä» rubyã¨ã³ã¸ãã¢ãªã®ã§rubyã®ãã¨ãæ¸ãã¾ãã RubyCriticã¯rubyã³ã¼ããéç解æãããã¼ã«ã§ããrubygemã§æä¾ããã¦ãã¾ãã åç´ãªä½¿ãæ¹ã¨ãã¦ã¯ã$ gem install rubycritic ãããªãbundler使ããªããã¦ã¤ã³ã¹ãã¼ã«ãã $ rubycritic . ãå®è¡ãã¾ãã$ rubycritic ./app ./lib ã®ããã«ãæå®ã®ãã£ã¬ã¯ããªã ãã対象ã«ãã¦å®è¡ãããã¨ãã§ãã¾ãã å®è¡ããã¨./tmp/ru
# bundle cd [gem] _orig_bundle=$(which bundle) function bundle() { if [ "$1" = "cd" ]; then local gem if [ "$2" ]; then gem=$2 else gem=$($_orig_bundle list | awk '{ print $2 }' | percol) fi cd $($_orig_bundle show $gem) else $_orig_bundle $* fi } Gemfileããããã£ã¬ã¯ããªã§å®è¡ããã¨percolãèµ·åãã¦ãé¸æããgemã®ãã£ã¬ã¯ããªã«cdã§ãããï¼pecoã使ã£ã¦ã人ã¯é©å®ç½®ãæããï¼ ã㢠èæ¯ githubã®ãªãã¸ããªãç°¡åã«åã£ã¦ãããghqã¨ãããã¼ã«ã¨gem-srcãçµã¿åãããã¨bundle install æã«èªåçã«gh
ã¯ããã« kakurenboãå ¬éãã¦ãã1å¹´ãçµéããããããæãã¨ããããã acts_as_paranoid ã®åªç¸ããè±å´ããè«çåé¤gemã§ãã kakurenbo-puti ãå ¬éãã¾ããã çµç·¯ã«ã¤ãã¦ã¯ãã¡ããã覧ãã ããã kakurenbo-puti kakurenbo(acts_as_paranoidç³»ã®gem)ã¯railsã®åé¤æ©è½ãè«çåé¤ã«ç½®ãæãããã¨ãç®çã«ä½ãããgemã§ãããkakurenbo-putiã¯railsã«è«çåé¤æ©è½ã追å ããç®çã§ä½ãããgemã§ãã ç½®ãæãã¨ã¯ç°ãªããActiveRecordãéæ¹é ããgemã§ã¯ããã¾ããã®ã§ãActiveRecordã®å é¨æ§é ã«å·¦å³ããã«ãããã³ã¼ããã·ã³ãã«(ã³ã¢ãã¡ã¤ã«ã¯70è¡ç¨åº¦)ã«ãªããããå ç¢ããä¿å®æ§ã®é¢ã§ããªãåªç§ãªgemã¨è¨ããã¨æãã¾ãã alfa-jpn/kakurenbo-put
Bulletã使ç¨ãã¦ãããä¸å³ã®ãããªã¡ãã»ã¼ã¸ã表示ãããã ã©ãããåå ã¯ä¸è¨ãã¥ã¼ã®artist.songs.sizeã¨ãã¦ããé¨åã§ãé¢é£ããã¢ãã«ã®ä»¶æ°ãè¨ç®ããããã«SELECT COUNT(*)ããã¼ã¿ã®æ°ã ãå®è¡ãã¦ãã¾ã£ã¦ããã ⦠<% @artists.each do |artist| %> <tr> <td><%= link_to artist.name, artist_path(artist) %></td> <td><%= artist.songs.size %></td> </tr> <% end %> ⦠Bulletã®ã¡ãã»ã¼ã¸ã§ã¯Counter Cacheã使ãã¨ãããã¨ã§ãããã使ãã°ä»¶æ°ããããããè¨ç®ãã¦ãã£ãã·ã¥ãã¦ããã®ã§SELECT COUNT(*)ããªãã¦æ¸ãããã«ãªãã ãã ãCounter Cacheã使ç¨ããã¨ãããããã¯ãçºçãã
Rubyã§ã¡ãã£ã¨ãããã¨ãä¾ãã°ããã¹ãå¦çãªã©ããããã¦ã¹ã¯ãªãããæ¸ããã¨ã¯ããããã¾ãããããªã¹ã¯ãªããã¯æå¤ã¨åå©ç¨ããããªããã®ã§ããããããä½æ¥ç¨ãã£ã¬ã¯ããªã«é©å½ãªãã¡ã¤ã«åã§ä¿åãã¦ãããããã¨æ¢ãåºãã®ã¯å°é£ã§ãããã³ãã³ãã©ã¤ã³ã«ã¯ã³ã©ã¤ãã¼ã§æ¸ãããã®ã ã¨ããããæ®ã£ã¦ããªããã¨ãããã¾ã1ãå¥ã®PCã§ã®åå©ç¨ãããããã®ä¿åæ¹æ³ã§ã¯å½ç¶ãªããä¸å¯è½ã§ãããã ããã§ãã©ããæ´çãããå ´æã«ä¿åãã¦ããã¦åå©ç¨ã«åãããã®ã§ãããä¿åå ãåé¡ã«ãªãã¾ã2ããããªã¨ããç§ã¯æ¬¡ã®ãããªçç±ããgemï¼RubyGemsï¼ã«ãã¦ãã¾ããã¨ã«ãã¦ãã¾ããæå ã§ããã«å®è¡ã§ãã¾ãããå¥ã®ç°å¢ã¸ã®ã¤ã³ã¹ãã¼ã«ãç°¡åã§ããã¾ããä»ã®Rubyããã°ã©ã ã¸ã®çµã¿è¾¼ã¿ãã³ããããã«å®ç¾ã§ãã¾ãããã¡ããä»ã®äººã使ããããã«ãªãã¨ããã¡ãªãããããã®ã§ãããèªåã®ç¨éã«éã£ã¦ãé·ãç®ã§è¦ã
install-ffmpeg-amazon-linux.sh �˥�U p ��U #!/bin/sh # Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh # and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos if [ "`/usr/bin/whoami`" != "root" ]; then echo "You need to execute this script as root." exit 1 fi cat > /etc/yum.repos.d/centos.repo<<EOF [centos] name=CentOS-6 â Base baseurl=http://mirror.centos.org/centos/6/os/x86_6
å°åãã緯度çµåº¦ãæ±ãããã緯度çµåº¦ããä½æç»é²ãããå ´åã«ä¾¿å©ãªã®ãããã®ãalexreisner/geocoderãã§ãã Active Recordã¨çµã¿åããã¨ã緯度çµåº¦ãç»é²ãããå¾ã¯èªåã§å¤æãè¡ãã«ã©ã ã追å ã§ããã¨ãã£ããã¨ãå¯è½ã«ãªãã¾ãã
ä½æã緯度çµåº¦ã«ç´ãããã緯度çµåº¦ããä½æãæ±ãããããæä½ãgeocodingã¨è¨ã£ã¦ãGoogle Maps APIã使ãã¨ã¾ãããã¦ãã®ãã¨ã¯ã§ããã ãã±ã¿ããAPIã¨ããYahoo!ã¸ãªã³ã¼ãAPIã¨ããæãããã ããã¯ã¨ãããããã®ã¸ããããããå©ãã³ã¼ããæ¸ãã¦ãã¦ãããããªã®ããã¨ã£ãã«èª°ããæ¸ãã¦ããããªãããªã¼ãã¨æã£ã¦ããã£ã¦ã¿ãããªãããããã®ãåºã¦ããã Ruby Geocoder ä½æã¨ç·¯åº¦çµåº¦ã®ç¸äºå¤æã¯ãã¡ãããè·é¢ãç¯å²ã®æ±ããGoogle以å¤ã®APIã¸ã®å¯¾å¿ããã£ãã·ã¥å¦çãªã©ããå®è£ ãããããªã¼ãã§ãããã©ããããããã¨ãæã£ã¦å éããã¦ãããããªæ©è½ãã»ã¨ãã©å ¨é¨å®è£ ããã¦ããã ä½æã®åå¾ require 'geocoder' # æ¥æ¬èªãã±ã¼ã«ã«è¨å® Geocoder.configure(ã:language => :ja, :units =>
Ruby ã§éåæå¦çãããã®ã« Sidekiq ã使ãå§ãã åºæ¬çãªä½¿ãæ¹ã«ã¤ãã¦ã¯ Rails - sidekiqã®ä½¿ãæ¹ - Qiita ãè¦ãã°åãã ä¸è¨è¨äºã«æ¸ããã¦ãªããã¨ã«ã¤ãã¦ã¤ãã¤ãã¨èªåç¨ã«ã¡ã¢ãæ®ãã¦ãã ãã¡ãã¡ã¯ã¼ã«ã¯ã©ã¹æ¸ããªãã¨ãããªãã® ActiveRecord 㨠ActionMailer ã«ä¾¿å©ã¡ã½ãããèªåçã«çãã Delayed extensions · mperham/sidekiq Wiki ã¹ã±ã¸ã¥ã¼ãªã³ã°ããã Scheduled Jobs · mperham/sidekiq Wiki 3æéå¾ã«å®è¡ãããå ´åãããªæã MyWorker.perform_in(3.hours, 'mike', 1) MyWorker.perform_at(3.hours.from_now, 'mike', 1) ã©ãã Sidekiq ã®ãã¼ã¢ã³èµ·åã
Faradayã®ãã°ããããã«ããããéä¿¡æéãªã©ããã°åºåããæ¹æ³ â» Rails ã¾ã㯠ActiveSupportãå¿ è¦ æ¤ç´¢ç¨ãã¼ã¯ã¼ã: faraday change custom format log output url time elapsed ããã©ã«ãã®ãã°åºåã¯ãã¾ããããã§ã¯ãªã ä¾ãã°ä»¥ä¸ã®ãããªæã I, [2015-03-23T18:25:52.041359 #10667] INFO -- : post http://localhost:3000/ D, [2015-03-23T18:25:52.041475 #10667] DEBUG -- request: User-Agent: "Faraday v0.9.1" Content-Type: "application/x-www-form-urlencoded" I, [2015-03-23T18:25:5
å®ã¯ãããã2014å¹´æåã®ã¨ã³ããªã¼ããµããããã WebAPIãå¼ã¶ã¹ã¯ãªããæ¸ãã®ã«Faradayã使ã£ã¦ã¿ãã®ã§ã使ãæ¹ãªã©ãã¡ã¢ã£ã¦ãããã¨æãã¾ãã Faradayèªä½ã¯åããç¥ã£ã¦ããã§ããããªãã¤ã¬ã¯ãã¨ãããã©ãããäºèããªãã¦è¯ãå ´åã«ã ç¹ã«HTTPã¯ã©ã¤ã¢ã³ãã®ã©ã¤ãã©ãªå ¥ãã¦ä½¿ããããNet::HTTPã§ååãããªãï¼ã¨æã£ã¦ä½¿ã£ãäºããã¾ããã§ããã ãªãã¨ãªã¼ããRubyæ¸ããããªã£ã¦ã使ã£ããã¨ãªãgemã使ã£ã¦ã¿ããã£ãã®ã§ã使ã£ã¦ã¿ã次第ã§ãã ã¡ãªã¿ã«ãèªã¿æ¹ã¯ ãµããã§ã ãªãã§ãããããï¼ ç°å¢ OS : Mac OS X 10.9.2 Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0] 使ç¨ããã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ gem 'faraday', '~> 0.9
Ruby ã® HTTP ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãª Faraday ã便å©ãã Ruby ã® HTTP ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãª Faraday ã便å©ãã API ã©ããã®éçºã«ã¯ RestClient gem ã ã¨ã OAuth ã®å¿ è¦ãªãã®ã¯ Net/HTTP + OAuth gem ã使ã£ã¦ã Twitter gem ã Instagram gem ãªã© API ã©ã¤ãã©ãªã®ã½ã¼ã¹ãèªãã§ã¿ã㨠Faraday gem ã¨ãããã®ããã使ããã¦ã ãªãã¨ãªãæ°ã«ãªã£ãã®ã§ Faraday ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã ã¤ãã§ã« Tumblife gem ã Faraday ã使ãããã«ãã 以ä¸ãã®ã¡ã¢ Faraday ã£ã¦ä½ï¼ Faraday is an HTTP client lib that provides a common interface over many adapters (su
ã¢ãã¤ã«ã¢ããªãµã¼ãã¹é¨ï¼ ã¢ãã¤ã«ããã¯ã¨ã³ãã°ã«ã¼ãã®äºååµã§ãã ããããä½åãã«åãã¦herã®ä½¿ãæ¹ãæ¸ãã¦ãããã¨æãã¾ãã remiprev/her: Her is an ORM (Object Relational Mapper) that maps REST resources to Ruby objects. It is designed to build applications that are powered by a RESTful API instead of a database. æ¦è¦ herã¯ActiveRecordã®ããã«æ¯ãèãRESTfulAPIã®ORMã§ãã ä»åã¯ãherã使ã£ã¦OAuth2.0ã®ClientCredentialsGrantã®ã¢ã¯ã»ã¹ãã¼ã¯ã³ãå©ç¨ããAPIã«ã¢ã¯ã»ã¹ãã¦ã¿ã¾ãã ç°å¢ Ruby: 2.2.4p230 Rails:
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}