rails new app-name --database=postgresql -BT
--database=postgresql-> Use postgres for database-B-> skip initial bundle install-T-> skip test suite (we're using rspec)
rails g controller welcome
| <?php | |
| /** | |
| * @package Food_example_plugin | |
| * @version 1.0 | |
| */ | |
| /* | |
| Plugin Name: Food example plugin | |
| Plugin URI: http://wordpress.org/extend/plugins/# | |
| Description: This is an example plugin for WPMU DEV readers | |
| Author: Carlo Daniele |
| var OFF = 0, WARN = 1, ERROR = 2; | |
| module.exports = exports = { | |
| "env": { | |
| "es6": true | |
| }, | |
| "ecmaFeatures": { | |
| // env=es6 doesn't include modules, which we are using | |
| "modules": true |
| # app/models/experience.rb | |
| # | |
| # == Schema Information | |
| # | |
| # Table name: experiences | |
| # | |
| # id :integer not null, primary key | |
| # title :string | |
| # description :text | |
| # created_at :datetime not null |
| module AuthRequestHelper | |
| def http_auth_as(username, password, &block) | |
| @env = {} unless @env | |
| old_auth = @env['HTTP_AUTHORIZATION'] | |
| @env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(username, password) | |
| yield block | |
| @env['HTTP_AUTHORIZATION'] = old_auth | |
| end | |
| def auth_get(url, params={}, env={}) |
| {% comment %} | |
| * | |
| * This loop loops through a collection called `collection_name` | |
| * and sorts it by the front matter variable `date` and than filters | |
| * the collection with `reverse` in reverse order | |
| * | |
| * To make it work you first have to assign the data to a new string | |
| * called `sorted`. | |
| * | |
| {% endcomment %} |
| #!/bin/sh | |
| # | |
| # This script is used on a QNAP TS-269 PRO. https://www.en0ch.se/qnap-and-rsync/ | |
| # | |
| # You have to change: | |
| # 1. $SHAREUSR | |
| # 2. $EXCLUDES (if you want o change the name of the file servername.excludes) | |
| # 3. $SOURCE & $DESTINATION | |
| # 4. user@yourserver.se for the mysqldump | |
| # 5. --password=SUPERSECRET |