(Comments: 1)

Chrome Extension: TypeScript Console

I code in TypeScript daily but there was something missing from my workflow. I was developing applications  in typescript_logoTypeScript but I was debugging them in JavaScript. Since my go to browser-of-choice is Chrome, I decided to rectify this issue.

TypeScript Console is a bare-bones Chrome extension that allows one to execute TypeScript to the console.  It is split into two Ace editors — TypeScript on the right, JavaScript on the left. Typing into the TypeScript editor automatically interrupts it to JavaScript. Hitting ‘CTRL+Enter’ executes the code.

As usual — the code and the extension itself are on my GitHub. Once I add a few more features (history, smart indent) I’ll be adding it to the Chrome Store.

typescript

 

 

 

(Comments: 2)

Download All Comixology Digital First Issue Comics: JavaScript Fun

When Marvel originally tried to give away 700+ plus comics — their servers crashed. If you were lucky enough to re-signup once Marvel got everything sorted out, invites/instructions are now going out on how to download your free digital comics.

Image 1

 

One small problem. Downloading them all is painful…really painful with all the clicking of the ‘Add Comic’ and ‘Next’ buttons. Don’t fret — there is an easier way. Just open a JavaScript console in your browser and run the following.

Comics (Windows 8)

(Comments: 0)

Extending Katana for fun and profit

The Katana Project is a server implementation of the Open Web Interface for .NET (OWIN) specification. InImage 4 simple terms: It is a web server that implements an agreed upon standard for communication between the host (server), middleware  and your application .

For my current project, I needed a way for Katana to serve files directly from an assembly via embedded resources. Since Katana was designed to be very extensible – it is trivial to add the functionality that I needed. Katana provides a StaticFile middleware out of the box, so by injecting a custom FileSystemProvider we can serve files directly from an assembly.

We’ll start out by telling the StaticFile middleware to use our custom ResourceFileSystemProvider.

For the actual ResourceFileSystemProvider – we need to implement IFileSystem. IFileSystem is an interface of just two methods, one to get information about a directory and the other to get information about a specific file. Both of these methods return a bool with an out parameter of type IFileInfo.

IFileInfo encapsulates information about a file (or directory). It also exposes a stream of the file contents. As you can see we just pass in a reference to the currently executing assembly and return the ManifestResourceStream.