jm + ruby   48

'a Ruby regular expression editor and tester'. Great for prototyping regexps with a little set of test data, providing a neat permalink for the results
regex  regexp  ruby  tools  coding  web  editors  testing 
july 2016 by jm
Ruby in Production: Lessons Learned — Medium
Based on the pain we've had trying to bring our Rails services up to the quality levels required, this looks pretty accurate in many respects. I'd augment this advice by saying: avoid RVM; use Docker.
rvm  docker  ruby  production  rails  ops 
march 2016 by jm
A Tour Through Random Ruby
turns out Ruby has a good set of random-text-generation gems on offer
random  ruby  coding  text-generation  markov-chain  gems 
july 2015 by jm
Hystrix-style Circuit Breakers and Bulkheads for Ruby/Rails, from Shopify
circuit-breaker  bulkhead  patterns  architecture  microservices  shopify  rails  ruby  networking  reliability  fallback  fail-fast 
june 2015 by jm
How We Moved Our API From Ruby to Go and Saved Our Sanity
Parse on their ditching-Rails story. I haven't heard a nice thing about Ruby or Rails as an operational, production-quality platform in a long time :(
go  ruby  rails  ops  parse  languages  platforms 
june 2015 by jm
For a Good Strftime
'Easy Skeezy Ruby Date/Time Formatting' -- or indeed anywhere else strftime() is supported
strftime  time  date  formatting  coding  ruby  via:oisin 
june 2015 by jm
On Ruby
The horrors of monkey-patching:
I call out the Honeybadger gem specifically because was the most recent time I'd been bit by a seemingly good thing promoted in the community: monkey patching third party code. Now I don't fault Honeybadger for making their product this way. It provides their customers with direct business value: "just require 'honeybadger' and you're done!" I don't agree with this sort of practice. [....]

I distrust everything [in Ruby] but a small set of libraries I've personally vetted or are authored by people I respect. Why is this important? Without a certain level of scrutiny you will introduce odd and hard to reproduce bugs. This is especially important because Ruby offers you absolutely zero guarantee whatever the state your program is when a given method is dispatched. Constants are not constants. Methods can be redefined at run time. Someone could have written a time sensitive monkey patch to randomly undefined methods from anything in ObjectSpace because they can. This example is so horribly bad that no one should every do, but the programming language allows this. Much worse, this code be arbitrarily inject by some transitive dependency (do you even know what yours are?).
ruby  monkey-patching  coding  reliability  bugs  dependencies  libraries  honeybadger  sinatra 
april 2015 by jm
The Large Hadron Migrator is a tool to perform live database migrations in a Rails app without locking.

The basic idea is to perform the migration online while the system is live, without locking the table. In contrast to OAK and the facebook tool, we only use a copy table and triggers. The Large Hadron is a test driven Ruby solution which can easily be dropped into an ActiveRecord or DataMapper migration. It presumes a single auto incremented numerical primary key called id as per the Rails convention. Unlike the twitter solution, it does not require the presence of an indexed updated_at column.
migrations  database  sql  ops  mysql  rails  ruby  lhm  soundcloud  activerecord 
march 2015 by jm
Speeding up Rails 4.2
Reading between the lines, it looks like Rails 4 is waaay slower than 3....
rails  ruby  performance  profiling  discourse 
december 2014 by jm
UNIX system service [jmason: ie a sidecar] that collects events and reliably delivers them to kafka, relieving other services on the same system from having to do so. Journals events through bolt-db so that in the event of an kafka outage, events can still be accepted, and will be delivered when kafka becomes available.
kafka  messaging  ruby  go  events  fault-tolerance  queueing 
november 2014 by jm
Rails migrations with no downtime
Ugh, Rails fail. It is impossible to drop a column from a Rails-managed table without downtime, even if nothing in the code accesses it (!!), without ugly hacks that don't even seem to work on recent versions of ActiveRecord.
activerecord  deploy  migrations  rails  ruby  sql  fail  downtime 
november 2014 by jm
"A command-line power tool for Twitter." It really is -- much better timeline searchability than the "real" Twitter UI, for example
twitter  ruby  github  cli  tools  unix  search 
october 2014 by jm
All Data Are Belong to AWS: Streaming upload via Fluentd
Fluentd looks like a decent foundation for tailing/streaming event processing in Ruby, supporting batched output to S3 and a bunch of other AWS services, Kafka, and RabbitMQ for output. Claims to have ok performance, despite its Rubbitude. However, its high-availability story is shite, so not to be used where availability is important
ruby  rabbitmq  kafka  tail  event-streaming  cep  event-processing  s3  aws  sqs  fluentd 
august 2014 by jm
Collection Pipeline
a nice summarisation of the state of pipe/stream-oriented collection operations in various languages, from Martin Fowler
martin-fowler  patterns  coding  ruby  clojure  streams  pipelines  pipes  unix  lambda  fp  java  languages 
july 2014 by jm
quotly/test/acceptance/adding_quotes_spec.rb at master · cavalle/quotly · GitHub
Decent demo of acceptance testing using rspec (and some syntactic sugar to make it read like Steak code, I think)
rspec  acceptance-testing  bdd  testing  ruby  coding 
june 2014 by jm
cavalle/steak · GitHub
a minimal extension of RSpec-Rails that adds several conveniences to do acceptance testing of Rails applications using Capybara. It's an alternative to Cucumber in plain Ruby.

Good approach here to copy, but very tied to Rails.
rails  ruby  testing  acceptance-testing  steak  bdd  rspec  coding 
june 2014 by jm
TDD is dead. Long live testing
Oh god. I agree with DHH. shoot me now.
Test-first units leads to an overly complex web of intermediary objects and indirection in order to avoid doing anything that's "slow". Like hitting the database. Or file IO. Or going through the browser to test the whole system. It's given birth to some truly horrendous monstrosities of architecture. A dense jungle of service objects, command patterns, and worse. I rarely unit test in the traditional sense of the word, where all dependencies are mocked out, and thousands of tests can close in seconds. It just hasn't been a useful way of dealing with the testing of Rails applications. I test active record models directly, letting them hit the database, and through the use of fixtures. Then layered on top is currently a set of controller tests, but I'd much rather replace those with even higher level system tests through Capybara or similar.

I think that's the direction we're heading. Less emphasis on unit tests, because we're no longer doing test-first as a design practice, and more emphasis on, yes, slow, system tests.
tdd  rails  testing  unit-tests  system-tests  integration-testing  ruby  dhh  mocks 
april 2014 by jm
A sane Google Protocol Buffers library for Ruby. It's all about being Buf; ProtoBuf.
protobuf  google  protocol-buffers  ruby  coding  libraries  gems  open-source 
april 2014 by jm
a system for building agents that perform automated tasks for you online. They can read the web, watch for events, and take actions on your behalf. Huginn's Agents create and consume events, propagating them along a directed event flow graph. Think of it as Yahoo! Pipes plus IFTTT on your own server. You always know who has your data. You do.

MIT-licensed open source, built on Rails.
ifttt  automation  huginn  ruby  rails  open-source  agents 
april 2014 by jm
A cautionary tale about building large-scale polyglot systems
'a fucking nightmare':
Cascading requires a compilation step, yet since you're writing Ruby code, you get get none of the benefits of static type checking. It was standard to discover a type issue only after kicking off a job on, oh, 10 EC2 machines, only to have it fail because of a type mismatch. And user code embedded in strings would regularly fail to compile – which you again wouldn't discover until after your job was running. Each of these were bad individually, together, they were a fucking nightmare. The interaction between the code in strings and the type system was the worst of all possible worlds. No type checking, yet incredibly brittle, finicky and incomprehensible type errors at run time. I will never forget when one of my friends at Etsy was learning Cascading.JRuby and he couldn't get a type cast to work. I happened to know what would work: a triple cast. You had to cast the value to the type you wanted, not once, not twice, but THREE times.
etsy  scalding  cascading  adtuitive  war-stories  languages  polyglot  ruby  java  strong-typing  jruby  types  hadoop 
march 2014 by jm
'A Ruby gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock,, and in a single call.'

This is about the nicest mock-time library I've found so far. (via Ben)
time  ruby  testing  coding  unit-tests  mocking  timecop  via:ben 
october 2013 by jm
A Case Against Cucumber
This is exactly my problem with Cucumber and similar BDD test frameworks.
When I write a Cucumber feature, I have to write the Gherkin that describes the acceptance criteria, and the Ruby code that implements the step definitions. Since the code to implement the step definitions is just normal RSpec (or whichever testing library you use), if someone else is writing the Gherkin, the amount of setup to create a working test should be about the same. So you’re only breaking even!

However, I don’t believe that it would really be breaking even. Cucumber adds another layer of indirection on top of your tests. When I’m trying to see why a specific scenario is failing, first I need to find the step that is failing. Since these steps are defined with regular expressions, I have to grep for the step definition.
ruby  testing  bdd  cucumber  rspec  coding 
september 2013 by jm
New Tweets per second record, and how | Twitter Blog
How Twitter scaled up massively in 3 years -- replacing Ruby with the JVM, adopting SOA and custom sharding. Good summary post, looking forward to more techie details soon
twitter  performance  scalability  jvm  ruby  soa  scaling 
august 2013 by jm
A command-line utility in Ruby to perform (a) OLAP cubing and (b) histogramming, given whitespace-delimited line data
ruby  olap  number-crunching  data  histograms  cli 
june 2013 by jm
Reducing MongoDB traffic by 78% with Redis | Crashlytics Blog
One for @roflscaletips. Crashlytics reduce MongoDB load by hacking in some hand-coded caching into their Rails app, instead of just using a front-line HTTP cache to reduce Rails *and* db load. duh. (via Oisin)
crashlytics  fail  roflscale  rails  caching  redis  ruby  via:oisin 
may 2013 by jm
Sup relaunched
hooray! Command-line gmailish goodness returns. And with a signed gem, to boot
gems  ruby  sup  mail  gmail  mua 
may 2013 by jm
Hey Judy, don't make it bad
Github get good results using Judy arrays to replace a Ruby hash. However: the whole blog post is a bit dodgy to me. It feels like there are much better ways to fix the problem:

1. the big one: don't do GC-heavy activity in the front-end web servers. Split that language-classification code into a separate service. Write its results to a cache and don't re-query needlessly.
2. why isn't this benchmarked against a C/C++ hash? it's only 36000 entries, loaded once at startup. lookups against that should be blisteringly fast even with the basic data structures, and that would also be outside the Ruby heap so avoid the GC overhead. Feels like the use of a Judy array was a "because I want to" decision.
3. personally, I'd have preferred they spend time fixing their uptime problems....

See also for more kvetching.
ruby  github  gc  judy-arrays  linguist  hashes  data-structures 
may 2013 by jm
Lucas Nussbaum’s Blog » Blog Archive » RVM: seriously?
+1. RVM is atrocious code -- some of the worst bash script I've seen. And it's not just installing as a command, it requires that it be sourced and hooks into your login shell. If you then use "set -e", it crashes; "set -u", it crashes; reset $HOME, crash. It's dire.
rvm  hate  fail  bash  scripting  ruby 
april 2013 by jm
serverspec - unit tests for servers
With serverspec, you can write RSpec tests for checking your servers are provisioned correctly. Serverspec tests your servers' actual state through SSH access, so you don't need to install any agent softwares on your servers and can use any provisioning tools, Puppet, Chef, CFEngine and so on.

(via Dave Doran)
via:dave-doran  puppet  testing  chef  cfengine  unit-testing  ops  provisioning  serverspec  rspec  ruby 
april 2013 by jm
Rails' Insecure Defaults
'13 Security Gotchas You Should Know About'
rails  security  ruby  web  tips 
march 2013 by jm
From a monolithic Ruby on Rails app to the JVM
How Soundcloud have ditched the monolithic Rails for nimbler, small-scale distributed polyglot services running on the JVM
soundcloud  rails  slides  jvm  scalability  ruby  scala  clojure  coding 
march 2013 by jm
aaw/hyperloglog-redis - GitHub
'This gem is a pure Ruby implementation of the HyperLogLog algorithm for estimating cardinalities of sets observed via a stream of events. A Redis instance is used for storing the counters.'
cardinality  sets  redis  algorithms  ruby  gems  hyperloglog 
january 2013 by jm
'a HTTP client mock library for Python, 100% inspired on ruby's FakeWeb [ ].' 'HTTPretty monkey patches Python's socket core module, reimplementing the HTTP protocol by mocking requests and responses.'
mocking  testing  http  python  ruby  unit-tests  tests  monkey-patching 
january 2013 by jm
Avoiding Hash Lookups in a Ruby Implementation
'If I were to sum up the past 6 years I've spent optimizing JRuby it would be with the following phrase: Get Rid Of Hash Lookups.'

This has been a particular theme of some recent optimization hacks I've been working on. Hashes may be O(1) to read, on average, but that doesn't necessarily mean they're the right tool for performance...

(via Declan McGrath)
via:declanmcgrath  hash  optimization  ruby  performance  jruby  hashing  data-structures  big-o  optimisation 
september 2012 by jm
The things make got right (and how to make it better)
jgc provides a good demonstration of how a general-purpose programming language tends to make a crappy DSL -- specifically Rakefiles
dsl  build  make  coding  jgc  languages  configuration  makefiles  rake  ruby  from delicious
january 2011 by jm
REPLs suck, I want something block oriented
good opinion piece; I agree, REPL isn't a usable approach for block-oriented languages
languages  repl  programming  ruby  hacking  coding  block-oriented  from delicious
july 2010 by jm
How do we kick our synchronous addiction?
great post on the hazards of programming in an async framework, and how damn hard it is. good comments thread too (via jzawodny)
via:jzawodny  coding  python  javascript  scalability  ruby  concurrency  erlang  async  node.js  twisted  from delicious
february 2010 by jm
Introducing Resque - GitHub
github's take on a good, distributed queueing system in Ruby
ruby  github  queueing  ipc  resque  from delicious
november 2009 by jm
Unicorn at GitHub
new Ruby HTTP server, using a preforked process pool based on select(). Github like it because of failure-recovery problems with Ruby threading bugs in Mongrel. The preforking algo used is extremely rudimentary -- the kind of thing we used in SpamAssassin before I implemented Apache-style preforking in 3.0
web  ruby  rails  github  nginx  httpd  server  mongrel  unicorn  rubyonrails  preforking  unix  fork  select  process-pool  from delicious
october 2009 by jm
Introducing BERT and BERT-RPC
another serialization format, binary, no IDL, no code generation, from GitHub
github  bert  erlang  ruby  rpc  protocol  thrift  serialization  networking  from delicious
october 2009 by jm
Hijack: Get A Live IRB Prompt For Any Existing Ruby Process
injects via gdb. pretty cool, if it works; one comment notes that they couldn't use it on a Rails app
gdb  hijack  ruby  debugging  irb  live  coding  rubygems  debugger 
august 2009 by jm
glTail.rb - realtime logfile visualization
'View real-time data and statistics from any logfile on any server with SSH, in an intuitive and entertaining way', supporting postfix/spamd/clamd logs among loads of others. very cool if a little silly
dataviz  visualization  tail  gltail  opengl  linux  apache  spamd  spamassassin  logs  statistics  sysadmin  analytics  animation  analysis  server  ruby  monitoring  logging  logfiles 
july 2009 by jm

related tags

acceptance-testing  ack  activerecord  adtuitive  agents  algorithms  analysis  analytics  animation  apache  architecture  async  automation  aws  bash  bdd  bert  best-practices  big-o  block-oriented  book  bugs  build  bulkhead  caching  cardinality  cascading  cep  cfengine  chef  circuit-breaker  cli  clojure  coding  concurrency  configuration  crashlytics  cucumber  curl  data  data-structures  database  dataviz  date  debugger  debugging  dependencies  deploy  dhh  discourse  docker  download  downtime  dsl  editors  erlang  etsy  event-processing  event-streaming  events  fail  fail-fast  fallback  fault-tolerance  flash  fluentd  fork  formatting  fp  free  gc  gdb  gems  github  gltail  gmail  go  google  graphite  hacking  hadoop  haproxy  hash  hashes  hashing  hate  hijack  histograms  honeybadger  http  httpd  huginn  hyperloglog  ifttt  integration-testing  ipc  irb  java  javascript  jgc  jruby  judy-arrays  jvm  kafka  lambda  languages  lhm  libraries  library  linguist  linux  live  logfiles  logging  logs  mail  make  makefiles  markov-chain  martin-fowler  memory  messaging  metrics  microservices  migrations  mocking  mocks  mongrel  monitoring  monkey-patching  mua  mysql  nagle  networking  nginx  node.js  nokogiri  number-crunching  ocr  olap  open-source  opengl  ops  optimisation  optimization  out-of-band  parse  passenger  patterns  pdf  performance  phusion  pipelines  pipes  platforms  polyglot  preforking  process-pool  production  profiling  programming  protobuf  protocol  protocol-buffers  provisioning  puppet  python  queueing  rabbitmq  rails  rake  random  redis  reference  regex  regexp  reliability  repl  resque  roflscale  rpc  rspec  rtt  ruby  rubygems  rubyonrails  rvm  s3  scala  scalability  scalding  scaling  scraping  scripting  search  security  select  serialization  server  serverspec  service-metrics  sets  shopify  sinatra  slides  soa  soundcloud  spamassassin  spamd  sql  sqs  statistics  steak  streams  strftime  strong-typing  sup  sysadmin  system-tests  tail  tcp  tdd  tesseract  testing  tests  text-generation  thrift  time  timecop  tips  tools  toread  twisted  twitter  types  unicorn  unit-testing  unit-tests  unix  via:ben  via:dave-doran  via:declanmcgrath  via:jzawodny  via:oisin  via:waxy  visualization  war-stories  web  web-services 

Copy this bookmark: