Skip to content

Instantly share code, notes, and snippets.

View EdCharbeneau's full-sized avatar
🏠
Working from home

Ed Charbeneau EdCharbeneau

🏠
Working from home
View GitHub Profile
@EdCharbeneau
EdCharbeneau / MyRazor.cshtml
Last active September 26, 2018 17:06
Moving JS outside of Razor
<div>
Razor things go here
</div>
@section Scripts {
<script src="myModule.js"></script>
<script>
myModule.init({
someRoute: @Url.Action("myRoute"),
someSetting: @Model.SomeSettingValue
@EdCharbeneau
EdCharbeneau / editor.html
Created August 29, 2018 21:53
CSS Strike in Kendo UI Editor
<!DOCTYPE html>
<html>
<head>
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<title></title>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.mobile.min.css" />
@EdCharbeneau
EdCharbeneau / sample.css
Last active August 29, 2018 21:38
Example
.st {
text-decoration: line-through;
}
@EdCharbeneau
EdCharbeneau / MyComponent.cshtml
Created August 29, 2018 17:46
Working with the Blazor JavaScript Interop 5
<div onclick="@HandleClick" class="my-component">
@Message
</div>
@functions {
string Message = "Click to change";
async void HandleClick()
{
Message = await PromptInterop.PromptAsync("Type a message");
StateHasChanged();
@EdCharbeneau
EdCharbeneau / PromptInterop.cs
Last active August 29, 2018 17:44
Working with the Blazor JavaScript Interop 4
using Microsoft.JSInterop;
public class PromptInterop
{
/// <summary>
/// Invokes a browser prompt and returns the user's input.
/// </summary>
public static Task<string> PromptAsync(string message) {
return JSRuntime.Current.InvokeAsync<string>("myNamespace.showPrompt",message);
}
@EdCharbeneau
EdCharbeneau / PromptInterop.cs
Created August 29, 2018 17:41
Working with the Blazor JavaScript Interop 3
using Microsoft.JSInterop;
public class PromptInterop
{
/// <summary>
/// Invokes a browser prompt and returns the user's input.
/// </summary>
public static Task<string> PromptAsync(string message) {
return JSRuntime.Current.InvokeAsync<string>("myNamespace.showPrompt",message);
}
@EdCharbeneau
EdCharbeneau / promptInterop.js
Last active August 29, 2018 17:44
Working with the Blazor JavaScript Interop 2
window.myNamespace = {
showPrompt: function (message) {
return prompt(message, 'Type anything here');
},
anotherFunction: function(args) { 
// do stuff 
}
};
@EdCharbeneau
EdCharbeneau / pseudoCodeInterop.cs
Last active August 29, 2018 17:44
Working with the Blazor JavaScript Interop
using Microsoft.JSInterop;
public class ExampleJsInterop
{
public static Task<T> MethodName(TArgs args)
{
// Implemented in exampleJsInterop.js
return JSRuntime.Current.InvokeAsync<T>("scope.jsMethod", args);
}
}
.Events(ev =>
{
ev.Select("foo");
ev.Show("bar");
})
function foo() {
// do selection code stuff
}
@EdCharbeneau
EdCharbeneau / Loan Granting Binary Classification.csv
Created May 17, 2017 14:27
Loan Granting Binary Classification data
We can't make this file beautiful and searchable because it's too large.
Loan ID,Customer ID,Loan Status,Current Loan Amount,Term,Credit Score,Years in current job,Home Ownership,Annual Income,Purpose,Monthly Debt,Years of Credit History,Months since last delinquent,Number of Open Accounts,Number of Credit Problems,Current Credit Balance,Maximum Open Credit,Bankruptcies,Tax Liens
6cf51492-02a2-423e-b93d-676f05b9ad53,7c202b37-2add-44e8-9aea-d5b119aea935,Charged Off,12232,Short Term,7280,< 1 year,Rent,46643,Debt Consolidation,777.39,18,10,12,0,6762,7946,0,0
552e7ade-4292-4354-9ff9-c48031697d72,e7217b0a-07ac-47dd-b379-577b5a35b7c6,Charged Off,25014,Long Term,7330,10+ years,Home Mortgage,81099,Debt Consolidation,892.09,26.7,NA,14,0,35706,77961,0,0
9b5e32b3-8d76-4801-afc8-d729d5a2e6b9,0a62fc41-16c8-40b5-92ff-9e4b763ce714,Charged Off,16117,Short Term,7240,9 years,Home Mortgage,60438,Home Improvements,"1,244.02",16.7,32,11,1,11275,14815,1,0
5419b7c7-ac11-4be2-a8a7-b131fb6d6dbe,30f36c59-5182-4482-8bbb-5b736849ae43,Charged Off,11716,Short Term,7400,3 years,Rent,34171,Debt Consolidation,990