Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
jasonroelofs / database_cleaner.rb
Created October 6, 2017 19:54
Configuring DatabaseCleaner for transaction and truncation
require "capybara/rspec"
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) do
if config.use_transactional_fixtures?
raise(<<-MSG)
Delete line `config.use_transactional_fixtures = true` from rails_helper.rb
(or set it to false) to prevent uncommitted transactions being used in
@jasonroelofs
jasonroelofs / gist:30b7efef4c8c38f38f689b7314b38b32
Created February 22, 2017 14:08
browserify test failures
Browserify: /Users/jroelofs/Development/browserify-rails/test/dummy/node_modules/.bin/browserifyinc -d --list --cachefile=/Users/jroelofs/Development/browserify-rails/test/dummy/tmp/cache/browserify-rails/browserifyinc-cache.json -o "/Users/jroelofs/Development/browserify-rails/test/dummy/tmp/cache/browserify-rails/output20170222-67719-sza12e" -
Browserify: /Users/jroelofs/Development/browserify-rails/test/dummy/node_modules/.bin/browserifyinc -d --cachefile=/Users/jroelofs/Development/browserify-rails/test/dummy/tmp/cache/browserify-rails/browserifyinc-cache.json -o "/Users/jroelofs/Development/browserify-rails/test/dummy/tmp/cache/browserify-rails/output20170222-67719-1ga4zhp" -
Exorcist: /Users/jroelofs/Development/browserify-rails/test/dummy/node_modules/.bin/exorcist /Users/jroelofs/Development/browserify-rails/test/dummy/app/assets/javascripts/application.map -b /Users/jroelofs/Development/browserify-rails/lib
F

Brian,

I believe you misunderstood the message I was trying to convey in my reply, but that's understandable as Twitter does not really provide a usable framework for such discussions. As such, I'm not going to try to reply in Twitter as I can't make that work but instead will line out my thoughts here.

To preface my original tweet: The Ruby community is oft known for arrogance, egotism, and shaming. Rubyists have not been a very welcoming bunch. I myself have readily partook in such discussions and joined the echo chamber far more often than I probably realize. As such, I've met many developers who refuse to touch the language in fear or disgust of having to deal with what has been a toxic community. I do believe that we as a Ruby community are better today but the damage has been done and won't quickly be forgotten.

As such, this is the last thing I want to happen to the budding and fantastic Elixir community. While a simple website like "canphoenixscale.com" is in itself harmless, it cannot be taken on

@jasonroelofs
jasonroelofs / dupefinder.js
Last active December 27, 2017 11:50 — forked from mattslack/dupefinder.js
Find duplicate IDs in a document.
(function () {
"use strict";
var find_dupes = function () {
var identified = document.querySelectorAll('[id]'),
found = {},
id,
idx;
for (idx = 0; idx < identified.length; idx++) {
id = (identified[idx]).getAttribute('id');
if(found[id]) {
/// All config-related options handled here
extern crate serialize;
use std::collections::HashMap;
use std::path::posix::Path;
use std::io::File;
use serialize::json;
#[deriving(Decodable, Encodable, Show)]
@jasonroelofs
jasonroelofs / 1 - master
Created August 12, 2014 19:17
Shopify profiling benchmarks
/Users/roelofs/.rvm/rubies/ruby-2.1.2/bin/ruby ./performance/benchmark.rb lax
Running benchmark for 60 seconds (with 5 seconds warmup).
Calculating -------------------------------------
parse: 2 i/100ms
parse & run: 1 i/100ms
-------------------------------------------------
parse: 28.3 (±7.1%) i/s - 1690 in 60.040297s
parse & run: 13.9 (±7.2%) i/s - 833 in 60.043217s
@jasonroelofs
jasonroelofs / 1) Master
Created July 31, 2014 18:40
Liquid profiler -- benchmarks against master
/Users/roelofs/.rvm/rubies/ruby-2.1.2/bin/ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 3.660000 0.020000 3.680000 ( 3.688094)
parse & run: 7.710000 0.010000 7.720000 ( 7.723662)
-------------------------------------- total: 11.400000sec
user system total real
parse: 3.480000 0.010000 3.490000 ( 3.491892)
parse & run: 7.650000 0.020000 7.670000 ( 7.662562)
@jasonroelofs
jasonroelofs / Shopify master
Last active August 29, 2015 14:04
Liquid Profiler benchmarking with CPU and Object
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
$ ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 3.410000 0.020000 3.430000 ( 3.428711)
parse & run: 7.490000 0.010000 7.500000 ( 7.500437)
-------------------------------------- total: 10.930000sec
user system total real
@jasonroelofs
jasonroelofs / 1_template.liquid
Created June 10, 2014 01:18
Example profiling of liquid template
{% include 'header' %}
<h1>{{ item.title }}</h1>
{{ request.host }}
{{ item.data.body }}
@jasonroelofs
jasonroelofs / master.txt
Last active August 29, 2015 14:02
Benchmark and Profile of Liquid performance with alias_method hooks (Ruby 2.1.2)
] rake benchmark:run benchmark:strict profile:run profile:strict
ruby ./performance/benchmark.rb lax
Rehearsal ------------------------------------------------
parse: 4.420000 0.030000 4.450000 ( 4.455098)
parse & run: 9.050000 0.030000 9.080000 ( 9.078304)
-------------------------------------- total: 13.530000sec
user system total real
parse: 4.320000 0.020000 4.340000 ( 4.339127)
parse & run: 8.810000 0.020000 8.830000 ( 8.832378)