TLDR: Rollup and ES modules give us:
- smaller bundles due to tree-shaking and scope-hoisting, and
- faster runtime perf than CommonJS, by avoiding runtime module resolution
Sources to back up these wild claims:
| // A few patterns to make it a bit easier to reason about the raw text. A more typesafe implementation might use full discriminated unions. | |
| let (|North|South|East|West|) = function | "N" -> North | "S" -> South | "E" -> East | "W" -> West | _ -> failwith "Unknown direction" | |
| let (|Rotate|MoveForward|) = function | 'L' | 'R' -> Rotate | 'M' -> MoveForward | _ -> failwith "Unknown command" | |
| let (|Left|Right|) = function | 'L' -> Left | 'R' -> Right | _ -> failwith "Unknown command" | |
| /// A DTO to represent the Rover | |
| type Rover = { X : int; Y : int; Direction : string } | |
| /// Moves the rover forward one unit. | |
| let driveForward rover = |
I ❤️ higher order functions and generally refuse to write non recursive looping structures. With Razor though I didn't have a great way of displaying lists without looping.
###Usage
The following code will render the _link partial for every item in the links list. It is basically a functor from data to output given a template.
@Html.RenderPartials("_link", links)
Without this extension I would have to write something like this
| import Quill from 'quill' | |
| import TableComponent from 'TableComponent' | |
| import ReactDOM from 'react-dom' | |
| const QuillEmbed = Quill.import('blots/block/embed'); | |
| class QuillTable extends QuillEmbed { | |
| static create(values) { | |
| let node = super.create(values); |
| using System; | |
| using System.IO; | |
| using System.Web; | |
| using System.Web.Hosting; | |
| namespace StackOverflow.Helpers | |
| { | |
| public static class Svg | |
| { | |
| // NOTE: To add a new SVG icon, copy paste the line below. Paste it after the other ones. |
| # update local list of pruned branches on the remote to local: | |
| git fetch --prune | |
| # delete branches on remote origin that have been merge to master | |
| git branch --merged remotes/origin/master -r | %{$_.trim().replace('origin/', '')} | ?{$_ -notmatch 'master'} | %{git push --delete origin $_} | |
| # delete local branches that have been merged to master | |
| git branch --merged remotes/origin/master | %{$_.trim()} | ?{$_ -notmatch 'master'} | %{git branch -d $_} | |
| # remove stale refs (local refs to branches that are gone on the remote) |
If you're thinking of checking out the Pony programming language, here's a list of things that I think are important to know. This list is based on a Tweet that I wrote.
There are Pony packages for several popular editors.
| using Xunit; | |
| namespace TheDukesOfDocker | |
| { | |
| [CollectionDefinition(nameof(EventStoreCollection))] | |
| public class EventStoreCollection : ICollectionFixture<EventStoreFixture> | |
| { | |
| } | |
| } |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <opml version="1.0"> | |
| <head> | |
| <title>Dave subscriptions in feedly Cloud</title> | |
| </head> | |
| <body> | |
| <outline text="Development" title="Development"> | |
| <outline type="rss" text="Scott Hanselman" title="Scott Hanselman" xmlUrl="http://feeds.feedburner.com/ScottHanselman" htmlUrl="https://www.hanselman.com/blog/"/> | |
| <outline type="rss" text="Cetus" title="Cetus" xmlUrl="https://feeds.feedburner.com/cetus/fVRw" htmlUrl="https://cetus.io/"/> |
In order of first appearance in The Morning Paper.