Skip to content

Instantly share code, notes, and snippets.

View jinan-kordab's full-sized avatar

Jinan Kordab jinan-kordab

View GitHub Profile
@jinan-kordab
jinan-kordab / admin.spec.js
Created June 15, 2022 21:11
Cypress spec E2E changefeed test with RethinkDb
/// <reference types="cypress" />
import Chance from "Chance";
const chance = new Chance();
//Testing Changefeeds in RethinkDB
context("Admin page", () => {
beforeEach(() => {
cy.generalLogin();
});
@jinan-kordab
jinan-kordab / separateprint.html
Created June 3, 2019 00:58
Printing separate section of your web page
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script src="Scripts/jquery-1.10.2.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
function printmydiv(divid) {
@jinan-kordab
jinan-kordab / Draggable.html
Created April 10, 2019 01:59
Responsive Design Draggable and Droppable functionality - by Jinan Kordab - demo
<html>
<!-- DESIGN BY JINAN KORDAB -->
<!-- DATE: APRIL 9, 2019 -->
<!-- BOOTSTRAP RESPONSIVE DESIGN - FRONT END ONLY -->
<!-- DEMO USAGE OFDRAG AND DROP FUNCTIONALITY. -->
<!-- I FOUND THAT JAVASCRIPT IS THE BEST OPTIONS O FAR FOR HANDLING DRAG AND DROP SINCE THERE ARE MANY THIRD PARTY LIBRARIES AS WELL -->
<!-- THIS PAGE SHOWS AN OPTIONS MENU,WITH BOOTSTRAP FOR RESPONSIVE DESIGN, WHEN DROPPED INTO THE MIDDLE CONTAINER,TRIGGERS THE droppable EVENT. -->
<!-- INSIDE droppable EVENT,WE CAN ADD AJAX CALLS TO BACK END OT TO ASP.NET MVC CONTROLLERS AND ACTION RESULTS TO GET DATA FROMD ATA BASE -->
@jinan-kordab
jinan-kordab / ReferenceFiles.js
Created March 30, 2019 23:01
Report Sub-report Reference Files JavaScript
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.7.1.js")"></script>
<script type="text/javascript" src="@Url.Content("~/bootstrap/js/bootstrap.js")" src="js/bootstrap.min.js"></script>
@jinan-kordab
jinan-kordab / ReportSubreportIndexView.cshtml
Created March 30, 2019 22:50
Report Subreport MVC View
<!DOCTYPE html>
<html lang="en">
<head>
<link href="~/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.7.1.js")"></script>
<script type="text/javascript" src="@Url.Content("~/bootstrap/js/bootstrap.js")" src="js/bootstrap.min.js"></script>
</head>
<body>
@jinan-kordab
jinan-kordab / ReportSubreportController.cs
Created March 30, 2019 22:48
Report Subreport MVC Controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Report_Subreport.Models;
namespace Report_Subreport.Controllers
{
public class HomeController : Controller
@jinan-kordab
jinan-kordab / Program.cs
Created February 1, 2019 00:11
Final exam requirement - helping students
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MainProject
{
class Program
@jinan-kordab
jinan-kordab / GroupingWithLinq.cs
Created January 22, 2019 15:14
Grouping DataTable raw records with LINQ
var DistinctGroupedColumns = dt.AsEnumerable().GroupBy(x => x.Field<Int32>("COLUMNONE")).Distinct().ToList();
foreach (var date in DistinctGroupedColumns)
{
//For each distinct record, get the associated list of records
var associatedListOfRecords = (from alofrec in dt.AsEnumerable() where alofrec.Field<Int32>("COLUMNONE").Date.ToString() == date.Key.ToString()
select alofrec).ToList();
int i = 0;
//The foreach below gets associated records per grouped group.
foreach (var timePart in associatedListOfRecords)
@jinan-kordab
jinan-kordab / HomeControllerSpinner.cshtml
Created November 11, 2018 14:11
Home Controller for Spinner and Download Stats ASP.NET App
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using PdfSharp.Drawing;
using TheArtOfDev.HtmlRenderer.PdfSharp;
@jinan-kordab
jinan-kordab / SpinnerFrontEnd.cshtml
Last active November 11, 2018 16:25
Front end page for Show Download Time and Spinner ASP.NET App
@{
ViewBag.Title = "Home Page";
}
<script type="text/javascript">
var myGlobalToken;
var SessionChecker;
$(document).ready(function () {