This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
(ns css.core | |
(:require [garden.core :refer [css]] | |
[garden.stylesheet :refer [at-keyframes at-media]])) | |
(def styles (atom {})) ;; styles cache | |
;; ignore this code, it generates unique short class names | |
(def cls->id (atom {})) | |
(def vc* (atom {:id 0 |
{:paths ["."] | |
:deps {clansi/clansi {:mvn/version "1.0.0"}}} |
class Dog | |
attr_writer :name | |
def initialize(name) | |
@name = name | |
end | |
def bark | |
puts "patrick" | |
end |
(ns om-2048.core | |
(:require-macros | |
[cljs.core.async.macros :refer [go go-loop]]) | |
(:require | |
[clojure.string :as str] | |
[cljs.core.async :as async :refer [<!]] | |
[dommy.core :as dommy] | |
[om.core :as om] | |
[om-tools.core :refer-macros [defcomponentk]] | |
[om-tools.dom :as dom :include-macros true])) |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
$ rails console | |
Loading development environment (Rails 3.0.6) | |
ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
Gives you a handle of all the routes (config/routes.rb) | |
#Inspect a named route: | |
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
=> {:action=>"destroy", :controller=>"sessions"} |
If you are build a saas, using VMs and management tools. You will find vagrant is useful for additional features.
But Virtual machines take too much time to load. Now there is a new trending called using docker. Docker is written in go, if you haven't heard of, you should probably go to check it out. In this article I am going to run a docker container in vagrant virtual machine
Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.
# In config/initializers/sprockets.rb | |
require 'sprockets' | |
require 'sprockets/server' | |
Sprockets::Server.class_eval do | |
private | |
def headers_with_rails_env_check(*args) |