Install: https://icons.getbootstrap.com/ As a font face
yarn add bootstrap-icons
Then update application.scss
| # Problem Statement: | |
| # | |
| # You are designing a basic garbage collection algorithm class. | |
| # | |
| # The goal of the class is to output an modified version of the input array containing | |
| # references to live objects, the remainder of objects will later be cleared by a function that | |
| # trims all the values | |
| # | |
| # Implement a function that returns a modified array containing a continous sub array of | |
| # live objects and their indices so that all dead objects can be chopped off by the garbage collector. |
| #!/bin/zsh | |
| function web2context() { | |
| if [[ $# -eq 0 ]]; then | |
| echo "Usage: web2context <url>" | |
| return 1 | |
| fi | |
| url="$1" | |
| temp_dir=$(mktemp -d) |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| lazy var persistentContainer: NSPersistentContainer = { | |
| let container = NSPersistentContainer(name: "DataModel") | |
| container.loadPersistentStores(completionHandler: { (storeDescription, error) in | |
| if let error = error as NSError? { | |
| fatalError("Unresolved error \(error), \(error.userInfo)") | |
| } | |
| }) |
| import React, { useRef, useState, useEffect } from "react"; | |
| const useForm = ({ initialValues, onSubmit }) => { | |
| const [values, setValues] = useState(initialValues || {}); | |
| const [errors, setErrors] = useState({}); | |
| const [touched, setTouched] = useState({}); | |
| const [onSubmitting, setOnSubmitting] = useState(false); | |
| const [onBlur, setOnBlur] = useState(false); | |
| const formRendered = useRef(true); |
Install: https://icons.getbootstrap.com/ As a font face
yarn add bootstrap-icons
Then update application.scss
| # post.cr | |
| class Post | |
| YAML.mapping({ | |
| name: String, | |
| description: String, | |
| }) | |
| end | |
| # factory.cr | |
| module Factory |
| /* | |
| * Sample API with GET and POST endpoint. | |
| * POST data is converted to string and saved in internal memory. | |
| * GET endpoint returns all strings in an array. | |
| */ | |
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" |
| # Generate a response array consistent with the requirements of the SPEC. | |
| # @return [Array] a 3-tuple suitable of `[status, headers, body]` | |
| # which is suitable to be returned from the middleware `#call(env)` method. | |
| def finish(&block) | |
| if STATUS_WITH_NO_ENTITY_BODY[status.to_i] | |
| delete_header CONTENT_TYPE | |
| delete_header CONTENT_LENGTH | |
| close | |
| return [@status, @headers, []] | |
| else |
See also: https://blog.robsdomain.com/twitter-bootstrap-in-rails-6/
Rails 6 mades large changes to how asset compilation is done. In specific sprockets has been removed for javascript processing and replaced with the common webpack utility. Sprockets remains in usage for CSS processing.
When it comes to asset bundling, the "Rails way" is webpack for JavaScript and Sprockets for everything else. The default setup in a fresh Rail 6 install, similar to what Basecamp uses, still compiles CSS, images, and fonts with Sprockets.
This means, if you're a member of the Basecamp camp, all your webpack JavaScript source files would live in app/javascript and all your Sprockets CSS and images would remain in app/assets. Running rails assets:precompile will first build all the Sprockets assets into the public/assets directory, then will build all the webpack assets into the public/packs directory.