Skip to content

Instantly share code, notes, and snippets.

View RandomUserPasswordGenerator.cs
/// <summary>
/// written by https://www.linkedin.com/in/majid-qafouri/
/// </summary>
public static class RandomUserPasswordGenerator
{
public class User
{
public string UserName { get; set; }
public string Password { get; set; }
}
@MajeQafouri
MajeQafouri / StringProtectionHelper.cs
Last active Jun 9, 2020
protecting string such as password in application to reuse in a further process like calling third party applications.
View StringProtectionHelper.cs
public static class SecurityHelper
{
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <param name="additionalString">Maximum length should be equal 5 character</param>
/// <returns></returns>
public static byte[] ProtectString(string value)
{
@MajeQafouri
MajeQafouri / JavaScriptRegularExpressionsPersianDate.html
Last active Nov 26, 2019
JavaScript Regular Expressions for Persian Date
View JavaScriptRegularExpressionsPersianDate.html
<html>
<body>
<h2>JavaScript Regular Expressions for Persian Date</h2>
<h2> Vlidation Result </h2>
<p id="demo"></p>
<script>
@MajeQafouri
MajeQafouri / FillKendoGrid.js
Last active Jul 27, 2019
To Fill a Kendo grid with an ajax call
View FillKendoGrid.js
$.ajax({
type: "POST",
url: link, // url of your action
data: args, // parameters if available
dataType: "json",
success: function (result) {
var grid = $("#KendoGridId").data("kendoGrid");
var dataSource = new kendo.data.DataSource({ data: result });
grid.setDataSource(dataSource);
@MajeQafouri
MajeQafouri / Timer.html
Last active Jun 12, 2019
Use java script's setInterval() function to create a flash text. Call ASP.NTE MVC action to get some new data and update the UI
View Timer.html
<html>
<head>
<meta charset="UTF-8" />
<title>Time sample code in java script</title>
<script>
var timeIntervId;
function changeColor() {
timeIntervId = setInterval(flashText, 500);
@MajeQafouri
MajeQafouri / BootBoxWithTextArea.js
Last active Jun 3, 2019
Sample code to define a function to show a boot box prompt to get user opinion and call the specific action in Asp.Net MVC
View BootBoxWithTextArea.js
var ShowBootBoxPrompt = function (message, callback) {
bootbox.prompt({
title: message,
buttons: {
cancel: {
label: 'cancel',
className: 'btn-Default',
callback: function () {
//do something