Skip to content

Instantly share code, notes, and snippets.

@avanderhoorn
avanderhoorn / dark.tcss
Last active December 4, 2017 14:46
CSS Modules Themes using CSS Variables
:root {
--alt-color: #111;
--main-color: #000;
--status-bar-background-color: #222;
--status-bar-font-color: #333;
}
@avanderhoorn
avanderhoorn / ProxyMethodEmitterTest.cs
Created October 8, 2015 18:43
Testing edge cases for casing of params/properties
public class ProxyMethodEmitterTest
{
public class TargetClass
{
public void TargetMethod(string name, int age)
{
Name = name;
Age = age;
}
public static class MapUseExtensions
{
public static IApplicationBuilder MapUse(this IApplicationBuilder app, PathString pathMatch, Action<IApplicationBuilder> configuration)
{
if (pathMatch.HasValue && pathMatch.Value.EndsWith("/", StringComparison.Ordinal))
{
throw new ArgumentException("The path must not end with a '/'", nameof(pathMatch));
}
// create branch
@avanderhoorn
avanderhoorn / HttpClientTest
Created November 25, 2014 22:06
HttpClient test
_httpClient.GetAsync("http://localhost:15316/Glimpse/Agent")
.ContinueWith(requestTask =>
{
// Get HTTP response from completed task.
HttpResponseMessage response = requestTask.Result;
// Check that response was successful or throw exception
response.EnsureSuccessStatusCode();
// Read response asynchronously as JsonValue and write out top facts for each country
@avanderhoorn
avanderhoorn / Overview
Created October 19, 2014 02:21
Client Data Workflow
CLIENT SERVER
+
1. Glimpse Opens |
`shell.ready` | +----+
+ | | |
| 2. requestRepository | | |
+---> .triggerGetLastestSummaries() +-----------+ 4. Request | | |
+ | | +---------------------------------> | |
@avanderhoorn
avanderhoorn / gulpfile.js
Created June 29, 2014 14:38
Prototype Gulp Setup
'use strict';
var gulp = require('gulp'),
gutil = require('gulp-util'),
jscs = require('gulp-jscs'),
jshint = require('gulp-jshint'),
tslint = require('gulp-tslint'),
typedoc = require('gulp-typedoc'),
react = require('gulp-react'),
typescript = require('gulp-tsc'),
@avanderhoorn
avanderhoorn / gist:7992849
Last active December 31, 2015 13:29
Glimpse Sample Metadata Payload
{
version:"1.6.1",
plugins:{
glimpse_sql:{
documentationUri:"http://getglimpse.com/Help/SQL-Tab",
keysHeadings:false,
layout:[
[
{
data:0,
@avanderhoorn
avanderhoorn / gist:7992793
Last active December 31, 2015 13:29
Sample Glimpse Payload
{
clientId:"Chrome 29.0",
dateTime:"12/16/2013 19:24:38",
duration:720.2,
parentRequestId:null,
requestId:"458bf4ab-fdea-42da-96ca-82adc93b5534",
isAjax:false,
method:"GET",
uri:"http://glimpseplay.azurewebsites.net/",
contentType:"text/html",
@avanderhoorn
avanderhoorn / gist:7237184
Created October 30, 2013 18:01
Better formatting for RequestModelConverter
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Glimpse.AspNet.Extensions;
using Glimpse.AspNet.Model;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Extensions;
using Glimpse.Core.Tab.Assist;
namespace Glimpse.AspNet.SerializationConverter
@avanderhoorn
avanderhoorn / AdvancedLayoutShoppingCart.cs
Last active December 19, 2015 21:29
Show the content of a shopping cart style of component you might have written, using a custom layout - Your Code, Your Plugins
public class TabCart : AspNetTab, ITabLayout
{
//UPDATED CODE
private static readonly object Layout = TabLayout.Create()
.Cell("items", TabLayout.Create().Row(r =>
{
r.Cell("{{albumTitle}} ({{albumId}})").AsKey().WithTitle("Album (Id)");
r.Cell("albumPrice").AlignRight().Prefix("$").WidthInPixels(100).WithTitle("Price");
r.Cell("genreName").WithTitle("Genre");
r.Cell("artistName").WithTitle("Artist");