You appear to be advocating a new:
- functional
- imperative
- object-oriented
- procedural
- stack-based
- "multi-paradigm"
- lazy
- eager
- statically-typed
You appear to be advocating a new:
This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!
A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:.
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace aes_example | |
| { | |
| using System; |
| defmodule MyTime do | |
| defstruct stamp: {0,0,0} | |
| defimpl Poison.Encoder, for: MyTime do | |
| def encode(%MyTime{} = t,options) do | |
| list = Tuple.to_list(t.stamp) | |
| Poison.Encoder.Map.encode(%MyTime{stamp: list},options) | |
| end | |
| end | |
| defimpl Poison.Decoder, for: MyTime do | |
| def decode(s,options) do |
| # Install our dependencies | |
| $ pip install -r <(wget -O- http://bit.ly/ssh_test_requirements) | |
| # Generate key pair without password | |
| $ ssh-keygen -t rsa -C "user@unicorn" | |
| Generating public/private rsa key pair. | |
| Enter file in which to save the key (/home/alex/.ssh/id_rsa): user.key | |
| Enter passphrase (empty for no passphrase): | |
| Enter same passphrase again: |
| (* type-level recursion with fold/unfold *) | |
| (* $ eff --effects -l rectypes.eff *) | |
| (* there's an unique isomorphism between fold and unfold such that: | |
| fold :: ...1 Unfix (...2 Fix (func) ...3) ...4 <=> ...1 Fix (func) ...4 :: unfold | |
| where func = \fix -> ...2 fix ...3 | |
| so, conceptually: |
| #!/bin/bash | |
| echo ECS_CLUSTER=your_ecs_cluser_name > /etc/ecs/ecs.config | |
| INSTANCE=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
| hostname $INSTANCE | |
| sed -i.bak "s/\\(HOSTNAME=\\).*/\\1$INSTANCE/" /etc/sysconfig/network | |
| # https://aws.amazon.com/blogs/compute/using-amazon-efs-to-persist-data-from-amazon-ecs-containers/ | |
| yum -y install jq |