profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/ngan/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

Gusto/buildkite-builder 20

A Ruby DSL for programmatically creating Buildkite pipelines.

ngan/riddle 2

Ruby Client API for Sphinx

keduong/moonrise 1

Kenny and Lauren's Wedding Website

ngan/cache-buildkite-plugin 1

A Buildkite Plugin for Caching -- Written in Ruby

ngan/capybara 1

Acceptance test framework for web applications

ngan/cruisecontrol.rb 1

CruiseControl for Ruby. Keep it simple.

ngan/environment 1

My environment setup all in one tool.

ngan/homebrew 1

The missing package manager for OS X.

ngan/rails 1

Ruby on Rails

ngan/rspec 1

Behaviour Driven Development framework for Ruby

PullRequestReviewEvent

issue closedffaker/ffaker

Custom modules?

Hi, more of a question than an issue.. is there a blessed way to add custom modules for domain specific fake data? Or do we just FFaker.autoload(...)?

closed time in 2 days

ngan

issue commentffaker/ffaker

Custom modules?

but what about rand 1_000..9_999?

Yea, I think that'll be fine. I'll report back if have any other cases to cover.

and faced with some troubles? Or just looking for "the best way"?

I haven't tried yet, but I don't imagine any troubles. This post was more of a "looking for the best way" 😄

Thank you for being so responsive!

ngan

comment created time in 2 days

issue commentffaker/ffaker

Custom modules?

https://github.com/ffaker/ffaker/discussions/categories/q-a

Please let me know if you’d like to move the conversation there. Happy to do so 😃 It’s hard to tell if repos prefer that or not. It’s trending there it seems.

If it's not a secret, why? Just curious.

Faker is a massive ecosystem of random generators that any given project will only use a small percentage of. You can arguably say the same for FFaker. However, we’ve identified that Faker uses i18n and adds to the locales path. This is not great in the world of Rails since those locales can we reloaded at various times in development. It also adds a good amount of time to have everything be loaded on boot, especially for tests (even with Spring). I really like that FFaker autoloads/lazyloads everything. Hence we’re trying to make the switch.

For what kind of data?

I’m not certain to be honest. We have a very, very large monolith and deal with $ and people data. I think most of the time leading-0 is fine. The problem is we have hundreds of engineers and they’ve grown accustom to “give me a 6-digit number” and expect a Integer that is 6 digits long. Nothing does this right out of the box for FFaker without the tricks that you’ve mentioned above.

Do you want to create a String of digits and then convert it to 9-digits Integer?… it sounds weird.

I don’t disagree…but it’s hard to know why people need that in my environment 😅 . Maybe they want to write a test case that handles a 4-digit dollar amount, which makes leading 0’s not OK. So it comes down to: Faker::Number.number(digits: 4) is much easier to understand than Integer(FFaker.numerify("#{rand(1..9)}###")) (IMHO).

If FFaker doesn’t want to support this then we can easily extend it.

ngan

comment created time in 2 days

issue commentffaker/ffaker

Custom modules?

Sorry, I wasn't clear. I can get specific... FFaker doesn't have a Number module that Faker has: https://github.com/faker-ruby/faker/blob/master/lib/faker/default/number.rb

Reading other issues, it seems that the maintainers of this gem isn't too keen on adding a Number module...which I get, kind of. We'd like to switch to FFaker, but we use Faker::Number.number(digits: 9) a lot. I get that you can do FFaker.numerify('#########') but the difference here is that Faker's implementation ensures a non-zero leading number, resulting in you always getting a 9-digit long integer (which is what Faker::Number returns).

I was going to port over some Faker::Number features in my codebase and was wondering what's the best way I can add more custom functionality to the existing FFaker library.

ngan

comment created time in 2 days

PullRequestReviewEvent

issue openedffaker/ffaker

Custom modules?

Hi, more of a question than an issue.. is there a blessed way to add custom modules for domain specific fake data? Or do we just FFaker.autoload(...)?

created time in 4 days

startedffaker/ffaker

started time in 6 days

push eventGusto/ruby

Ngan Pham

commit sha 53cc391dfe99c4a84eac635c6cb9fe95f693f1a6

Skip document for gem install

view details

push time in 7 days

push eventGusto/ruby

Ngan Pham

commit sha 38cc1ca58089cc971452a38eaa4de484118474a2

chmod GEM_HOME for better non-root support

view details

push time in 7 days

push eventGusto/ruby

Ngan Pham

commit sha 9738ac741213e256f4f0047d9d7b84fe37bb03ed

Update Dockerfile

view details

push time in 9 days

delete branch ngan/bootsnap

delete branch : fix-encoding-for-rails-apps

delete time in 10 days

pull request commentShopify/bootsnap

Set encoding for write pipe

@byroot @casperisfine wdyt?

ngan

comment created time in 10 days

push eventtubaxenor/bootsnap

Ngan Pham

commit sha 14cf703da1ca61b656a15ba147bc81ed8eb8fdec

Update worker_pool.rb

view details

push time in 10 days

push eventngan/bootsnap

Ngan Pham

commit sha c6ecffc09e9c036dac817a22cba3ea34cdfca1ca

Update changelog

view details

push time in 10 days

PR opened Shopify/bootsnap

Set encoding for write pipe

This fixes the Encoding::UndefinedConversionError error for Rails applications. Rails sets the default encoding to UTF8: https://github.com/rails/rails/blob/main/railties/lib/rails.rb#L22-L23

We want to set it to Binary but the IO.pipe method only sets it for the reader, not the writer.

+5 -1

0 comment

1 changed file

pr created time in 10 days

create barnchngan/bootsnap

branch : fix-encoding-for-rails-apps

created branch time in 10 days

fork ngan/bootsnap

Boot large Ruby/Rails apps faster

fork in 10 days

push eventtubaxenor/bootsnap

Ngan Pham

commit sha fc31883438dfd4556f1402351172b44b5efb1392

Update worker_pool.rb

view details

push time in 10 days

push eventtubaxenor/bootsnap

Ngan Pham

commit sha 62ef0281adb28b993bea547632c266082879f329

Update worker_pool.rb

view details

push time in 10 days

delete branch ngan/bootsnap

delete branch : patch-1

delete time in 10 days

push eventtubaxenor/bootsnap

Ngan Pham

commit sha 333cfa6005597e9531737ef3f63679510d796446

Set binary mode for IO.pipe

view details

Ngan Pham

commit sha 3360426091972c5a99aa9506652d548ec5cd5dce

Merge pull request #1 from ngan/patch-1 Set binary mode for IO.pipe

view details

push time in 10 days

PR merged tubaxenor/bootsnap

Set binary mode for IO.pipe
+2 -2

0 comment

1 changed file

ngan

pr closed time in 10 days

PR opened tubaxenor/bootsnap

Set binary mode for IO.pipe
+2 -2

0 comment

1 changed file

pr created time in 10 days

push eventngan/bootsnap

Ngan Pham

commit sha 333cfa6005597e9531737ef3f63679510d796446

Set binary mode for IO.pipe

view details

push time in 10 days

fork ngan/bootsnap

Boot large Ruby/Rails apps faster

fork in 10 days

issue commentShopify/bootsnap

Encoding::UndefinedConversionError when added Bootsnap (Rails 5.2.2 / Ruby 2.6.1).

Ah, here is a relevant thread: https://github.com/rails/rails/issues/16514#issuecomment-52313290

bartekb

comment created time in 10 days

issue commentShopify/bootsnap

Encoding::UndefinedConversionError when added Bootsnap (Rails 5.2.2 / Ruby 2.6.1).

@burke we’re running into this problem as well. After some debugging seeing that it’s because of the Marshall.dump call in the workers. You can see other projects fixing this problem with force_encoding: https://github.com/raen79/fie/pull/28/files#diff-0edfaa39170d32cc54d3828513983709153ea1aa172dea942fb01c9db7de57e5R28

In IRB…

 _, io_write = IO.pipe
io_write.write(Marshal.dump([:ruby, "/var/www/packs/custom_report_builder/spec/services/report/custom_worker/source/employees/column/emergency_contact_phone_number_spec.rb"]))
 => 153

In Rails console…

_, io_write = IO.pipe
io_write.write(Marshal.dump([:ruby, "/var/www/packs/custom_report_builder/spec/services/report/custom_worker/source/employees/column/emergency_contact_phone_number_spec.rb"]))
Encoding::UndefinedConversionError: "\x86" from ASCII-8BIT to UTF-8
bartekb

comment created time in 10 days

delete branch Gusto/ruby

delete branch : np-fullstaq-ubuntu20

delete time in 12 days

push eventGusto/ruby

Ngan Pham

commit sha 5e0ea59597aa9b94dd5bcc4fb7fe9280916be8e4

Fullstaq Ruby 2.7.4 on Ubuntu 20.04

view details

Ngan Pham

commit sha ddb1a41b918f35a92d0eaf4973c8c4232f354298

Remove common

view details

Ngan Pham

commit sha 847a29827a11f7e1459c98594bd6211315621266

Fix tabbing

view details

Ngan Pham

commit sha 3f0f9943602570f02d8583140f7e51c4990ce265

Merge pull request #24 from Gusto/np-fullstaq-ubuntu20

view details

push time in 12 days