Skip to content

Instantly share code, notes, and snippets.

View NickersF's full-sized avatar
🚀
Preparing to launch a great product.

Nicholas Fazzolari NickersF

🚀
Preparing to launch a great product.
  • Association of Oregon Counties
  • Portland Or
View GitHub Profile
@NickersF
NickersF / tilelayoutbuilder.ts
Created April 1, 2022 17:16
Tile layout builder AJAX call without .when() wrapper
$.ajax({
type: "GET",
url: "/" + controllerName + "/" + actionName
}).then((data) => {
console.log(performance.now());
self.configurationObject = JSON.parse(data);
self.tileLayoutRootElement = tileLayoutRootEl;
self.buildTileLayoutConfiguration();
if (data != undefined || null || "Error Message") {
@NickersF
NickersF / maptemplate.html
Created September 27, 2021 14:15
Tile Layout Map Template Updated 10/25/21
<script id="MapTile" type="text/x-kendo-template">
<div class="container-fluid d-flex flex-column pl-0 pr-0 h-100">
<div class="row no-gutters pt-2 pb-2">
<div class="col-md-auto d-flex align-items-center pl-3 pr-3">
<label class="mb-0" for="mapSource">Select map layer: </label>
</div>
<div id="mapSource" class="col-md-3">
<select id="RISFeatureList" class="custom-select custom-select-sm" name="RISFeatureList">
<option value="RISCulvert">Culverts</option>
<option value="RISSign" selected>Signs</option>
@NickersF
NickersF / oldTemplateLoader.js
Created September 16, 2021 22:31
Old Kendo Template loader
export function irisTileViewBuilder(paths) {
for (let i = 0; i < paths.length; i++) {
$.get(paths[i]).done(function (result) {
$("body").append(result);
}).then(function (result) {
let bodyTemplate = kendo.template($("#TestTemplate").html(), { useWithBlock: false });
// function call to create tileview here
}).fail(function () {
@NickersF
NickersF / tilelayoutsample.ts
Created September 16, 2021 19:49
Tile Layout Sample
$("#tilelayout").kendoTileLayout({
containers: [{
colSpan: 6,
rowSpan: 4,
header: {
text: "Item three"
},
bodyTemplate: kendo.template($("#MapTemplate").html())
}, {
colSpan: 3,
@NickersF
NickersF / reader.cs
Created August 17, 2021 16:18
Example of Binary Data no AJAX MVC
// Upload and transfer data to API/DB
[HttpPost]
public async Task<ActionResult> UploadFiles()
{
// Checking no of files injected in Request object
if (Request.Files.Count > 0)
{
try
{
// Get all files from Request object
@NickersF
NickersF / jsonTocsv.js
Created August 13, 2021 21:40
JSON To CSV Converter
// Convert JSON to CSV file and automatically download when called
function convertJSONtoCSV(JSONData, providedFileName, parseHeaders) {
// If JSONData is not an object then JSON.parse will parse the JSON string in an Object
let arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
let processedCSV: string = "";
// Generate the headers if argument is passed as true
if (parseHeaders) {
@NickersF
NickersF / site-icon-styles.less
Created July 1, 2021 21:34
IRIS Icon Sizing CSS Rules
.iris-icon-sizer-01 {
height: 1em;
width: 1em;
}
@NickersF
NickersF / Custom_Icon_Snippet.cshtml
Created July 1, 2021 21:30
Custom Icon Snippet
<span><img src="~/Content/Icons/Drawer/info-circle-solid.svg" class="iris-icon-sizer-01" /></span>
@NickersF
NickersF / VisualStudio2019Colors.cs
Created May 21, 2021 22:18
Clock IT VS Theme Colors
VisualStudio2019.Palette.AccentColor = (Color)ColorConverter.ConvertFromString("#FF5399EE");
VisualStudio2019.Palette.AccentMainColor = (Color)ColorConverter.ConvertFromString("#FF5399EE");
VisualStudio2019.Palette.AccentDarkColor = (Color)ColorConverter.ConvertFromString("#FF233042");
VisualStudio2019.Palette.AccentSecondaryDarkColor = (Color)ColorConverter.ConvertFromString("#FF2E6FF2");
VisualStudio2019.Palette.AccentMouseOverColor = (Color)ColorConverter.ConvertFromString("#FF5399EE");
VisualStudio2019.Palette.AccentFocusedColor = (Color)ColorConverter.ConvertFromString("#FF2E6FF2");
VisualStudio2019.Palette.AccentForegroundColor = (Color)ColorConverter.ConvertFromString("#FFBBD3F0");
VisualStudio2019.Palette.ValidationColor = (Color)ColorConverter.ConvertFromString("#FFFF3333");
VisualStudio2019.Palette.BasicColor = (Color)ColorConverter.ConvertFromString("#FFBBD3F0");
VisualStudio2019.Palette.SemiBasicColor = (Color)ColorConverter.ConvertFromString("#FFEAEFF6");
@NickersF
NickersF / SQLConnection.cs
Created May 21, 2021 01:06
ADO.NET SQL Server connection
private string connectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=WPF_Data;Integrated Security=True;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
string SQL_SELECT = "SELECT * Data_Table";
SqlConnection conn = new SqlConnection(connectionString);
SqlDataAdapter da = new SqlDataAdapter();
SqlCommand sql = conn.CreateCommand();
sql.CommandText = SQL_SELECT;
da.SelectCommand = sql;
DataSet ds = new DataSet();