Install: https://icons.getbootstrap.com/ As a font face
yarn add bootstrap-icons
Then update application.scss
| # AGENTS | |
| # AGENTS.md — Headless macOS / iOS Development | |
| For any assistance: https://scottwillsey.com/building-and-shipping-mac-and-ios-apps-without-ever-opening-xcode/ | |
| This repo is built, tested, signed, notarized, and shipped entirely from the | |
| command line. Xcode.app must be installed (its toolchain is required), but it | |
| is never opened. Do not suggest opening Xcode, using the Organizer, or any | |
| GUI step — every job below has a CLI equivalent and that's the only one this |
| # 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 |