Skip to content

Instantly share code, notes, and snippets.

View davidmles's full-sized avatar
🏠
Working from home

David Morales davidmles

🏠
Working from home
View GitHub Profile
@davidmles
davidmles / environment.js
Last active August 4, 2021 09:29
environment.js file with a hack to load PostCSS 8 with Webpacker 5
// https://github.com/rails/webpacker/issues/2784#issuecomment-737003955
function hotfixPostcssLoaderConfig (subloader) {
const subloaderName = subloader.loader
if (subloaderName === 'postcss-loader') {
if (subloader.options.postcssOptions) {
console.log(
'\x1b[31m%s\x1b[0m',
'Remove postcssOptions workaround in config/webpack/environment.js'
)
} else {

Keybase proof

I hereby claim:

  • I am davidmles on github.
  • I am davidmles (https://keybase.io/davidmles) on keybase.
  • I have a public key ASA9VSN0C2d9ZkD8WuS9vEYsaQfwgCCDZmxPoIcws2rWjwo

To claim this, I am signing this object:

@davidmles
davidmles / init.coffee
Created December 15, 2015 17:57
init.coffee for Atom
atom.workspace.observeTextEditors (editor) ->
path = editor.getPath()
return unless path?
fileTypes =
'.html.erb': 'text.html.ruby',
'.rb': 'source.ruby.rails'
for extension of fileTypes when \
path.toLowerCase().endsWith(extension.toLowerCase()) and
@davidmles
davidmles / gist:66af6291314bf56f3321
Created June 27, 2014 16:38
Minitest profile in a new Rails app
david$ bin/rake -rprofile test
% cumulative self self total
time seconds seconds calls ms/call ms/call name
7.69 0.01 0.01 113 0.09 0.27 MonitorMixin#initialize
7.69 0.02 0.01 41 0.24 7.07 ActiveSupport::Dependencies::Loadable#load_dependency
7.69 0.03 0.01 75 0.13 0.13 Rake::TaskManager#resolve_args_without_dependencies
7.69 0.04 0.01 257 0.04 0.23 Rake::TaskManager#define_task
7.69 0.05 0.01 107 0.09 2.34 nil#
7.69 0.06 0.01 68 0.15 0.15 Kernel#initialize_dup
7.69 0.07 0.01 466 0.02 0.24 Class#new
@davidmles
davidmles / gist:79a2b7c20bfa9b2a1281
Created June 27, 2014 10:39
Minitest profile in a new Rails engine
david$ test/dummy/bin/rake -rprofile test
Run options: --seed 62041
# Running:
.
Finished in 0.004231s, 236.3507 runs/s, 236.3507 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips