Skip to content

Instantly share code, notes, and snippets.

View ChrisMoney's full-sized avatar

Chris Weathers ChrisMoney

  • Onevested
  • St. Louis, MO
View GitHub Profile
@ChrisMoney
ChrisMoney / edit.component.html
Created May 11, 2018 19:45
Angular Edit Modal
<div mat-dialog class="container">
<div mat-dialog-title class="dialog-title">
Edit - {{ documentContent.name }}
<span class="title-spacer"></span>
<button mat-icon-button mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
<div mat-dialog-content fxLayout="column" fxLayoutAlign="space-between stretch">
@ChrisMoney
ChrisMoney / object.js
Last active December 14, 2017 20:15
Create Object in Knockout
function Attachment(data) {
this.id = ko.observable(data.AttachmentId);
this.name = ko.observable(data.AttachmentName);
this.size = ko.observable(data.AttachmentSizeText);
this.isEmail = ko.observable(data.IsEmail);
}
// map data object from server to Knockout object
var mappedAttachments = $.map(data.detail.Attachments, function (item) { return new Attachment(item); });
self.attachments(mappedAttachments);
@ChrisMoney
ChrisMoney / knockout-dropdown.cshtml
Last active December 11, 2017 18:06
Bind Drop Down in Knockout
<section>
<label class="label">To: </label>
<label class="select">
<select class="form-control input-sm" data-bind="options: emailList,
optionsText: 'Name',
optionsValue: 'ID',
optionsCaption: '-- Select --'"></select>
<i></i>
</label>
</section>
@ChrisMoney
ChrisMoney / knockout-view.cshtml
Created November 30, 2017 23:25
UI for Knockout binding
<!-- ko stopBinding: true -->
<div id="TaskFilters">
<div class="tmsUIwidget" data-bind="css: { 'jarviswidget-color-chartergreen': (isSourceFilterSet() || isUserFilterSet() || isStatusFilterSet() || isSubStatusFilterSet() || isPriorityFilterSet() ||
isSupervisorFilterSet() || (isDateFilterActive())),
'jarviswidget-color-charterblue': (!isSourceFilterSet() && !isUserFilterSet() && !isStatusFilterSet() && !isSubStatusFilterSet() && !isPriorityFilterSet() &&
(!isDateFilterActive())),
}"
data-widget-colorbutton="false" data-widget-editbutton="false" data-widget-deletebutton="false" data-widget-fullscreenbutton="false" data-widget-custombutton="false" data-widget-sortable="false">
<header class="txt-color-white" data-toggle="collap
@ChrisMoney
ChrisMoney / knockout.cs
Created November 30, 2017 22:18
This is C# files contains the actions methods that knockout gets its data from.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Threading.Tasks;
using TMS.Automation.BLL.JobProfilesManager;
using TMS.BLL.JobGroupManager;
using TMS.Common;
using TMS.Common.Enums;
using TMS.Common.Extensions;
@ChrisMoney
ChrisMoney / knockout.js
Created November 30, 2017 22:17
Knockout code called by action method in C# MVC Controller
var FilterViewModel = function (afterFilter)
{
/*************************************************************
* Task Group Filters **
************************************************************/
function TaskGroupFilters(data)
{
this.id = ko.observable(data.Id);
this.name = ko.observable(data.Name);
@ChrisMoney
ChrisMoney / LogError.cs
Created April 20, 2017 18:31
Log Error
// define function
public static void WriteEventLog(string Error)
{
// Create the source, if it does not already exist.
if (!System.Diagnostics.EventLog.SourceExists("FEC Events"))
{
//An event log source should not be created and immediately used.
//There is a latency time to enable the source, it should be created
//prior to executing the application that uses the source.
//Execute this sample a second time to use the new source.
@ChrisMoney
ChrisMoney / wireshark.txt
Created March 28, 2017 18:35
Wireshark - How To
Type in filer box: ip.addr == 192.168.90.112 (your ip)
Double click your NIC (Network Card) Not a VM but actual Ethernet
@ChrisMoney
ChrisMoney / SafeInvoke.cs
Created March 27, 2017 14:30
Safe Invoke - Thread Safe Dispatcher.CheckAccess(), Dispatcher.Invoke and Implementation
public void DispatchIfNecessary(Action action) {
if (!Dispatcher.CheckAccess())
Dispatcher.Invoke(action);
else
action.Invoke();
}
// Invoke thread safe method
DispatchIfNecessary(() => {
methodCall();
Click once deploys its files to : C:\Users\Domain(Username)\AppData\Local\Apps\2.0\
From here you have to go through the files and determine which generate file contains the Debug like folder.