Skip to content

Instantly share code, notes, and snippets.

View nikmd23's full-sized avatar
Waiting for next season...

Nik Molnar nikmd23

Waiting for next season...
View GitHub Profile
@nikmd23
nikmd23 / TransformStream.js
Last active April 9, 2020 20:57
Basic Implementation of a Transform (Pass-through) Stream
function TransformStream() {
var readableController,
writableController,
readable = new ReadableStream({
start(controller) {
readableController = controller;
},
cancel(reason) {
writableController.error(reason);
}
<html>
<head>
<title>Code Qualities</title>
<style>
.grid {
display: grid;
width: 100%;
height: 100%;
grid-template-columns: repeat(4, 1fr);
// This Gist was created to answer @rionmonster's tweet at http://www.twitter.com/rionmonster/status/669288962444419072
// This accurately reflects the state of Glimpse 2.0.0-Beta1, however we are already looking to improve this and these
// will most likey change.
// Feedback and use cases are welcome and wanted!
// This is a portion of Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddGlimpse().RunningServerWeb(options =>
Func<Foo, IDictionary<string, object>> func = f => {
var result = new Dictionary();
result.Add("one", f.Name);
result.Add("two", f.Id);
return result;
}
class Person
{
public Person(string name = "Joe Somebody")
{
Name = name;
}
public string Name { get; private set; }
public string Greet()
@nikmd23
nikmd23 / BrokenGlimpse.log
Created July 2, 2013 12:18
Log file of a broken request for issue Glimpse/Glimpse#398
2013-06-25 10:36:41.1778 | DEBUG | Discovering IClientScript's in 'C:\Users\BigRed\AppData\Local\Temp\Temporary ASP.NET Files\root\a8fefafb\c6145503' and all sub directories. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Client' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Data' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Metadata' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovering IInspector's in 'C:\Users\BigRed\AppData\Local\Temp\Temporary ASP.NET Files\root\a8fefafb\c6145503' and all sub directories. |
2013-06-25 10:36:41.5548 | DEBUG | Discovered IInspector of type 'Glimpse.Ado.Inspector.AdoInspector' and added it to collection. |
2013-06-25 10:36:41.5548 | DEBUG | Discovered IInspector of type 'Glimpse.EF.Inspector.EntityFrameworkInspector' and added it to collect
@nikmd23
nikmd23 / ShowingGlimpse.log
Created July 2, 2013 12:16
Log file of a working request for issue Glimpse/Glimpse#398
2013-06-25 10:36:41.1778 | DEBUG | Discovering IClientScript's in 'C:\Users\BigRed\AppData\Local\Temp\Temporary ASP.NET Files\root\a8fefafb\c6145503' and all sub directories. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Client' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Data' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovered IClientScript of type 'Glimpse.Core.ClientScript.Metadata' and added it to collection. |
2013-06-25 10:36:41.5208 | DEBUG | Discovering IInspector's in 'C:\Users\BigRed\AppData\Local\Temp\Temporary ASP.NET Files\root\a8fefafb\c6145503' and all sub directories. |
2013-06-25 10:36:41.5548 | DEBUG | Discovered IInspector of type 'Glimpse.Ado.Inspector.AdoInspector' and added it to collection. |
2013-06-25 10:36:41.5548 | DEBUG | Discovered IInspector of type 'Glimpse.EF.Inspector.EntityFrameworkInspector' and added it to collect
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- IE10 Plug-in setting
Including this tag will force plug-in-less "Metro IE10" to prompt the user to open the URL in "Desktop IE10" which supports plug-ins.
@nikmd23
nikmd23 / controller.cs
Created February 29, 2012 22:19
Use JsonpResult
public ActionResult ActionMethod()
{
var data = GetDataSomehow();
return new JsonpResult(data);
//constructor overload for overriding callback function
//return new JsonpResult(data, "callback function");
}
@nikmd23
nikmd23 / jsonpClient.js
Created February 29, 2012 21:50
JSONP Client with jQuery
$(function () {
$.ajax({
dataType: 'jsonp',
url: 'http://example.com/JSONP/API/',
success: function (data) {
console.log(data);
}
});
});