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:
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:
| import 'dart:convert'; | |
| Map<String, dynamic> parseJwt(String token) { | |
| final parts = token.split('.'); | |
| if (parts.length != 3) { | |
| throw Exception('invalid token'); | |
| } | |
| final payload = _decodeBase64(parts[1]); | |
| final payloadMap = json.decode(payload); |
| /* HOC fundamentally is just a function that accepts a Component and returns a Component: | |
| (component) => {return componentOnSteroids; } or just component => componentOnSteroids; | |
| Let's assume we want to wrap our components in another component that is used for debugging purposes, | |
| it just wraps them in a DIV with "debug class on it". | |
| Below ComponentToDebug is a React component. | |
| */ | |
| //HOC using Class | |
| //it's a function that accepts ComponentToDebug and implicitly returns a Class | |
| let DebugComponent = ComponentToDebug => class extends Component { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| /* | |
| * Copyright 2012 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |