Skip to content

Instantly share code, notes, and snippets.

View nalabjp's full-sized avatar
☀️
🌴

nalabjp nalabjp

☀️
🌴
View GitHub Profile
This file has been truncated, but you can view the full file.
diff --git a/activerecord/.gitignore b/activerecord/.gitignore
index 8d747034f6..f2516307fa 100644
--- a/activerecord/.gitignore
+++ b/activerecord/.gitignore
@@ -1,4 +1,5 @@
/sqlnet.log
/test/config.yml
/test/db/
+/test/storage/
/test/fixtures/*.sqlite*
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index c5d7bcd34b..6a26eb8487 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,266 +1,273 @@
-## Rails 6.1.7.7 (February 21, 2024) ##
+## Rails 7.1.3.2 (February 21, 2024) ##
* No changes.
@nalabjp
nalabjp / string_interpolation_in_yaml.rb
Created November 23, 2018 09:27
String Interpolation in YAML
require 'yaml'
ENV.update('foo' => 'FOO')
ENV.update('bar' => 'BAR')
ENV.update('baz' => 'BAZ')
p YAML.load(<<EOS)
---
foo: !ruby/string #{ENV['foo']}
bar: !str #{ENV['bar']}
baz: ! #{ENV['baz']}
EOS
module DSL
def capture
'DSL#capture'
end
end
module Helper
def call_capture
capture
end
" Shortcuts
map "q" nextTab
map "shift+q" previousTab
unless File.exists?('./Gemfile')
File.write('./Gemfile', <<~GEMFILE)
source 'http://rubygems.org'
gem 'activerecord'
gem 'sqlite3'
GEMFILE
system 'bundle install --path=vendor/bundle'
end
require 'bundler/setup'
rails_version = ENV['R4'] ? '4.2.8' : '5.0.2'
def bundle_install(version)
gemfile = "./Gemfile-#{version}"
ENV.update('BUNDLE_GEMFILE' => gemfile)
unless File.exists?(gemfile)
File.write(gemfile, <<~GEMFILE)
source 'http://rubygems.org'
gem 'rails', "#{version}"
GEMFILE
unless File.exists?('./Gemfile')
File.write('./Gemfile', <<~GEMFILE)
source 'http://rubygems.org'
gem 'activesupport'
GEMFILE
system 'bundle install --path=vendor/bundle'
end
require 'bundler/setup'
require 'active_support'
@nalabjp
nalabjp / q2.rb
Last active December 23, 2016 11:20
require 'benchmark/ips'
module Cond
OPS = ['*',''].freeze
RANGE = (1000..10000).freeze
end
class Proc0
def self.run(num, ops, ret)
# @note Synonymous with the following implementation, but maybe slow
@nalabjp
nalabjp / realforce_sleep_problem.md
Last active July 1, 2016 11:04
realforceを繋いでいてスリープから復帰する際にキーボードで復帰しようとすると復帰後に認識されないアレ

現象

realforceを繋いでいてスリープから復帰する際にキーボードで復帰しようとすると復帰後に認識されない

  • iMacだと問題なし
  • Macbookproはダメ

原因?

  • スリープの種類がiMacとMacbookproでは違う
  • pmset -gで確認
    • iMacはhibernatemodeが0 (sleep)
  • Macbookproはhibernatemodeが3 (safe sleep)