This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| :def hoogle \x -> return $ ":!hoogle --count=15 \"" ++ x ++ "\"" | |
| :def doc \x -> return $ ":!hoogle --info \"" ++ x ++ "\"" | |
| :set -Wall | |
| :set -fno-warn-type-defaults -ferror-spans -freverse-errors -fprint-expanded-synonyms | |
| :set prompt "\ESC[0;32m%s\n\ESC[m[ghci]\ESC[38;5;172mλ \ESC[m" | |
| :set prompt-cont " \ESC[38;5;172m> \ESC[m" |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o errtrace | |
| set -o nounset | |
| set -eou pipefail | |
| function clearscreen { | |
| printf '\033c' | |
| } |
| import css from "rollup-plugin-css-porter"; | |
| import pkg from "../../package.json"; | |
| import resolve from "rollup-plugin-node-resolve"; | |
| import babel from "rollup-plugin-babel"; | |
| import path from "path"; | |
| import commonjs from "rollup-plugin-commonjs"; | |
| import { terser } from "rollup-plugin-terser"; | |
| process.env.BABEL_ENV = "production"; | |
| process.env.NODE_ENV = "production"; |
The easiest way to get the ClamAV package is using Homebrew
$ brew install clamav
Before trying to start the clamd daemon, you'll need a copy of the ClamAV databases.
Inside /your/location/to/brew/etc/clamav, you'll see 2 files:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| class PolicyTest < ActiveSupport::TestCase | |
| def assert_permissions(current_user, record, available_actions, permissions_hash = {}) | |
| permissions_hash.each do |action, should_be_permitted| | |
| if should_be_permitted | |
| assert_permit current_user, record, action | |
| else | |
| refute_permit current_user, record, action | |
| end | |
| end |
You probably don't want Google crawling your development staging app. Here's how to fix that.
$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt
Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.