the lite-ist stack: rails, sqlite, litestack, litestream, and fly one of my favorite technologies is sqlite. it lets us build apps with fewer dependencies and less devops, which i love. you can run it in memory to create db-backed ruby scripts in a standalone file. iâm a fan of sqliteâs origin story (i started my career working for the navy and dod). i get an irrational kick out of being able to s
æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: For clarity merging hashes use with_defaults - Andy Croll åæå ¬éæ¥: 2023/11/20 åèè : Andy Croll Railsã¯ãå¯èªæ§ãé«ããããã«Active Supportã§æ¢åã®ã³ã¢Rubyã¯ã©ã¹ã«å¤ãã®ã¡ã½ããã追å ãããã¨ã§ç¥ããã¦ãã¾ããHashã¯ã©ã¹ã®with_defaultsã¡ã½ããããã®1ã¤ã§ããwith_defaultsã¡ã½ããã¯ãå¥é追å æ¸ã¿ã®reverse_mergeã¡ã½ããã®ã¨ã¤ãªã¢ã¹ãªã®ã§ããã®ååãåä½ãç¥ãæãããã¨ãªãã¯ãã§ãã reverse_mergeã¡ã½ããã®ã½ã¼ã¹ã³ã¼ããè¦ãã¨ãããããã«ãå®è£ ã¯å®ã«ç°¡ç´ ã§ãã ð 以ä¸ã®ããã«æ¸ãããã ããã©ã«ãå¤ãHash#mergeã§è¿½å ããã user_provided =
users.where(users[:name].eq('amy')) # SELECT * FROM users WHERE users.name = 'amy' basic join In ActiveRecord (without Arel), if :photos is the name of the association, use joins users.joins(:photos) In Arel, if photos is defined as the Arel table, photos = Photo.arel_table users.join(photos) users.join(photos, Arel::Nodes::OuterJoin).on(users[:id].eq(photos[:user_id])) join with conditions users.
Rico's cheatsheets Hey! I'm @rstacruz and this is a modest collection of cheatsheets I've written. bash Bash scripting enzyme Enzyme es6 ES2015+ go Go react React.js sass Sass vim Vim xpath Xpath Recently updated jsdoc Jsdoc packs Packs (ruby) polyfill.io Polyfill.io tmux tmux docker-compose docker-compose cron Cron yum YUM screen Screen clip Command Line Interface Pages tig Tig tar tar atom Atom
æ¦è¦ å ãµã¤ãã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: Gemfile of dreams: the libraries we use to build Rails appsâMartian Chronicles, Evil Martiansâ team blog åææ´æ°æ¥: 2024/05/28 åèè : Vladimir Dementyevï¼é¦å¸ããã¯ã¨ã³ãã¨ã³ã¸ãã¢ï¼ãTravis Turnerï¼æè¡è¨äºç·¨éè ï¼ ãµã¤ã: Evil Martians -- ãã¥ã¼ã¨ã¼ã¯ããã·ã¢ãä¸å¿ã«æ ç¹ãæ§ããRuby on Railséçºä¼ç¤¾ã§ããè¯è³ªã®ããã°è¨äºãå¤æ°å ¬éããå¤ãã®gemã®ã¹ãã³ãµã¼ã§ãããã¾ãã æ¥æ¬èªããã°: ååä¼ç¤¾ã¤ã¼ãã«ãã¼ã·ã£ã³ãº - Qiita æ¥æ¬èªã¿ã¤ãã«ã¯å 容ã«å³ãããã®ã«ãã¾ãããã¾ããgemãã¨ã«GitHubãªãã¸ããªã¸ã®ãªã³ã¯ã«ã¼ãã追å ãã¦ã
ã¾ããã æ¬è¨äºã¯ãç§ãRailsConf 2019ã§è©±ãããTerraforming legacy Rails applicationsãâã®ãããã°Bé¢ã«ç¸å½ãã¾ãããã®è¨äºãèªãã§ãçãããã¢ããªã±ã¼ã·ã§ã³éçºãDockerã«ä¹ãæããã¨ã¾ã§ã¯èãã¦ãã¾ããï¼çããã以ä¸ã®åç»ã§è¥å¹²è¨åãã¦ããã®ãã覧ã«ãªã£ã¦ããã¨ãã¦ãï¼ãæ¬è¨äºã®çãã¯ãç§ãç¾å¨ã®Railsããã¸ã§ã¯ãã§ç¨ãã¦ããè¨å®ãçããã¨å ±æãããã¨ã§ãããããã®Railsããã¸ã§ã¯ãã¯ãEvil Martiansã®production developmentç°å¢ã§çã¾ãããã®ã§ããã©ãããèªç±ã«ã使ããã ããã åæå 責äºé : è±èªçè¨äºã¯ææ°ã®æ¨å¥¨äºé ã«åããã¦æ´æ°ãç¹°ãè¿ãã¦ãã¾ãã詳ããã¯è¨äºæ«å°¾ã®Changelogãã覧ãã ããï¼åè: åæChangelogï¼ã ç§ãdevelopmentç°å¢ã§Dockerã使
ä»åã®åææ§æ㯠3 ã¤ã®ãã¤ã¯ããµã¼ãã¹ã§æ§æãããã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ã§ããããã®ãã¡ 2 ã¤ã¯ä¾å¹´éãåè¨èªã§ã®å®è£ ãç¨æããã¦ãã¾ãããã3 ã¤ç®ã¯åã«ã³ã³ãã¤ã«æ¸ãã¤ããªãç½®ãã¦ããã ãã¨ããæãã§ããããã®ãããåè 2 ã¤ã®ã¢ããªã±ã¼ã·ã§ã³ã¯ã³ã¼ãå 容ãå«ãæ¹åãã¤ã¤ã3 ã¤ãã®ã¢ããªã±ã¼ã·ã§ã³ã«ã¤ãã¦ã¯æ¬ä½ãæ¹åä¸å¯è½ã¨è«¦ãããããã¢ããªã±ã¼ã·ã§ã³ã極åå¼ã°ãªãããã«ããã®ãéè¦ã ã£ãããªã¨æãã¾ãã ä»åã®ä¸»é¡ã¨ãªãã¢ããªã±ã¼ã·ã§ã³ã¯ isuda ã¨å¼ã°ããã·ã³ãã«ãªãªã³ã©ã¤ã³è¾æ¸æ稿ãµã¼ãã¹ã§ãããåèªã®è§£èª¬è¨äºé¨åã®ããã¹ãã«ã¯ä»ã®åèªã¸ã®ãã¼ã¯ã¼ããªã³ã¯ãæ¿å ¥ããã¦ããã¨ããä»æ§ããã£ãã®ã§ãæ°ããåèªãæ稿ããããã³ã«ããã®åèªãå«ãæ¢åã®åèªã®è§£èª¬è¨äºé¨åãåçæããå¿ è¦ãããã¨ãããã®ã§ããã æã ã®ãã¼ã ã§ã¯ Ruby å®è£ ãæ¹åãã¦ããã¾ããããRuby
ã¦ã½ã¿ãããªæ¬å½ã®è©±ãRuby ã§ãã¡ãã³ã³ã¨ãã¥ã¬ã¼ã¿ãæ¸ãã¦ã¿ã¾ããã æ°ã«ãªãé度ã§ãããèªåã®ç°å¢ã§ã¯ 20 fps ã¡ãã£ã¨åºã¾ãããã¡ãã³ã³ã¯ 60 fps ãªã®ã§ãå®éã® 1/3 ã§ããRuby3x3 ï¼Ruby 3 㯠Ruby 2 ã® 3 åéãï¼ã¨ãã matz ã®å®£è¨ãå®ç¾ããã°ãå®éãéæããããã¨ã«ãªãã¾ããï¼ è©¦ãã¦ã¿ãã人ã¯ãããªãµãã«å®è¡ãã¦ãã ããã $ gem install ffi $ git clone http://github.com/mame/optcarrot.git $ cd optcarrot $ bin/optcarrot examples/Lan_Master.nesSDL2 ã SFML ãé©åã«ã¤ã³ã¹ãã¼ã«ããã¦ããå¿ è¦ãããã¾ããDebian/Ubuntu ãªã apt-get install libsdl2-dev ã§ã Ru
class Mulder include Enumerable SCULLYS_WORDS = %w(ã¢ã«ãã¼ ããªã ç²ãã¦ã ã®ã).map(&:freeze).freeze SCULLYS_NATURAL_REMARK = SCULLYS_WORDS.dup.insert(1, 'ã').join.freeze def each(&block) @words ||= SCULLYS_WORDS .shuffle .each_slice(2) .map { |pair| join_capriciously(pair) } .flatten .insert(2, 'ã') @words.each(&block) end def to_s to_a.join end def natural? to_s == SCULLYS_NATURAL_REMARK end private def jo
def mulder %w[ã¢ã«ãã¼ ããªã ç²ãã¦ã ã®ã].shuffle.each_slice(2).map { |ws| ws.map { |w| w.chars.each_slice((w.size/2.0).ceil).map(&:join) }.flatten.tap{ |_| break [_[2], _[1], _[0], _[3]] if rand(2) == 0 } }.flatten.insert(2, 'ã').join end loop.with_index(1) do |_, i| print "#{i}: " puts mulder.tap{ |_| exit puts(_).to_i if _ == 'ã¢ã«ãã¼ãããªãç²ãã¦ãã®ã' } end 1: ã®ããããªãã¢ã«ãã¼ç²ãã¦ã 2: ã®ã¦ããç²ããã¢ã«ãã¼ããªã 3: ã®ããç²ãã¦ãããªãã¢ã«ãã¼ 4:
Ruby ã§æé»ã®ãããã¯ãã©ã¡ã¼ã¿ã使ãããã® gem ãã¤ããã¾ããã å ãã¿ : Rubyã®ãããã¯ã¤ããåé¡ã解決ããæé»ã®ãããã¯ãã©ã¡ã¼ã¿ - Qiita github : osyo-manga/gem-use_arguments ã¤ã³ã¹ãã¼ã« $ gem install use_arguments å®ç¾©ãããæé»ã®ãããã¯ãã©ã¡ã¼ã¿ ãã©ã¡ã¼ã¿ æå³ _1, _2..._N åå¼æ°ã®è¦ç´ _ _1 ã¨åã _args å ¨å¼æ°ã®é å _yield ãããã¯å¼æ° _self å¼ã³åºããã Proc ãªãã¸ã§ã¯ãèªèº« _receiver ãããã¯ã渡ããã¡ã½ããã®ã¬ã·ã¼ã 使ãæ¹ ä½¿ãæ¹ã¯ç°¡åã§ããããã¯ã®å¼æ°ãå®ç¾©ãã代ããã« _1 ã _2 ã¨ãã£ããã¬ã¼ã¹ãã«ããå¤ããã«ä½¿ç¨ãã¾ãã require "use_arguments" # Array ã¯ã©ã¹ã®ã¡ã½ããã«å¯¾ãã¦ä½¿ç¨
Here is an example rubium app I call mruby-edit. It's a code editor written entirely in Ruby - including all DOM event handlers and manipulations. It's implemented on top of Ace, but uses Ruby to configure Ace keybindings, and access the file system. In the image, mruby-edit is viewing its own source code. Mruby-edit was written entirely in Ruby as a proof of concept, but you can freely switch bet
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}