Install the Rails gem if you haven't done so before
| MIX_ENV=prod mix compile.protocols | |
| MIX_ENV=prod PORT=4001 elixir -pa _build/prod/consolidated -S mix phoenix.server |
| import java.util.Iterator; | |
| import java.util.NoSuchElementException; | |
| // Introduction: | |
| // | |
| // This is an example class meant to illustrate several differen concepts: | |
| // * The use of type parameters (i.e. Java generics) | |
| // * Implementing an iterator over some collection, in this case an array | |
| // * Implementing the Iterable interface, which enables your collection | |
| // to work with the Java simple for loops, i.e. (for String s : list) |
if you got this error while requesting the application via JSON request:
exception ActionController::InvalidAuthenticityToken
backtrace":"[\"/home/uadmin/.rvm/gems/ruby-2.1.7/gems/actionpack-4.2.4/lib/action_controller/metal/request_forgery_protection.rb:181:in `handle_unverified_request'\",
\"/home/uadmin/.rvm/gems/ruby-2.1.7/gems/actionpack-4.2.4/lib/action_controller/metal/request_forgery_protection.rb:209:in `handle_unverified_request'\",
...
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf is your best friend.
| (setq enh-ruby-program "/home/gnufied/.rbenv/versions/1.9.3-p448/bin/ruby") | |
| (autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t) | |
| (add-to-list 'auto-mode-alist '("\\.rb$" . enh-ruby-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.rake$" . enh-ruby-mode)) | |
| (add-to-list 'auto-mode-alist '("Rakefile$" . enh-ruby-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.gemspec$" . enh-ruby-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.ru$" . enh-ruby-mode)) | |
| (add-to-list 'auto-mode-alist '("Gemfile$" . enh-ruby-mode)) | |
| (add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode)) |
| (source "melpa" "http://melpa.milkbox.net/packages/") | |
| (source "gnu" "http://elpa.gnu.org/packages/") | |
| (source "marmalade" "http://marmalade-repo.org/packages/") | |
| (depends-on "ac-js2") | |
| (depends-on "adaptive-wrap") | |
| (depends-on "ag") | |
| (depends-on "auto-complete") | |
| (depends-on "calfw") | |
| (depends-on "cask") |
| require "active_record" | |
| namespace :db do | |
| db_config = YAML::load(File.open('config/database.yml')) | |
| db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
| desc "Create the database" | |
| task :create do | |
| ActiveRecord::Base.establish_connection(db_config_admin) |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
