Markdown Cheat Sheet

Headlines
# Headline 1
## Headline 2
### Headline 3

Styling
*italic*
**bold**
~~strike through~~

Links
http://url.com
[link text](http://www.url.com)

Quotes
> Quote text
***Johnny Author***

Images
![image alt text](image url)
***Image caption, description***

Horizontal rule
---

Inline Code
`var name = "John Doe";`

Code block with syntax highlighting
``` codelanguage
function foo() {
  return bar;
}
```

Bulleted list
- item 1
- item 2
- item 3

Numbered list
1. item 1
2. item 2
3. item 3

coffeescript and webpacker

enable the use of coffeescript files in a rails 6 application

by rolf

It is not that hard to do. And, with the rails-6 philosophy in mind, i wanted to avoid creating a javascripts-directory in the assets-path... Following the readme at the github rails/webpacker site, just a few commands:

bundle exec rails webpacker:install:coffee

This will alter my config/webpack/environment.js:

const { environment } = require('@rails/webpacker')
const coffee =  require('./loaders/coffee')



const webpack = require('webpack')
environment.plugins.prepend('Provide',
  new webpack.ProvidePlugin({
    $: 'jquery/src/jquery',
    jQuery: 'jquery/src/jquery'


  })
)

environment.loaders.prepend('coffee', coffee)

module.exports = environment

It will create a folder 'loader' in config/webpack, which now contains a file called 'coffee.js'

module.exports = {
  test: /\.coffee(\.erb)?$/,
  use: [{
    loader: 'coffee-loader'
  }]
}

In your 'javascripts/packs' directory you will find a file 'hello_coffee.coffee', which will output a message in the console when you require it in 'javascripts/packs/application.js' (the script will not do this for you...)

require("packs/hello_coffee")

config/webpacker.yml will have an extension added:

- .coffee

restart your server, look for the message in the console - if it is there, you're good to go.

happy days ;-)


rails 7 javascript- and css- files part 1

loose webpacker and node-modules directory

by rolf

versioning applications

easy and concise versioning by the app_verion gem

by rolf