Skip to content

Instantly share code, notes, and snippets.

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

Salar Rabbal rabbal

🏠
Working from home
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@alirezanet
alirezanet / Iran96-97.json
Last active March 17, 2024 14:41
List of provinces, states and cities of Iran with geographical coordinates (96-97 update)
[
{
"latitude": "34° 31' 24.924",
"longitude": "50° 0' 20.866",
"province": "مرکزی",
"state": "آشتیان",
"city": "آشتیان"
},
{
"latitude": "33° 40' 29.197",
@tolemac
tolemac / StructureMapAOP.cs
Last active May 11, 2020 20:11
AOP using StructureMap + Castle.DynamicProxy
using System;
using System.Collections.Generic;
using StructureMap;
using StructureMap.Building.Interception;
using StructureMap.Pipeline;
namespace AOPStructureMap
{
public interface IAppService
{
@AlexanderLindsay
AlexanderLindsay / bootstrap-v4-modal-load.js
Created April 24, 2016 03:04
javascript to load a bootstrap modal content from an anchor tag
// boostrap 4 load modal example from docs
$('#modal-container').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget); // Button that triggered the modal
var url = button.attr("href");
var modal = $(this);
// note that this will replace the content of modal-content ever time the modal is opened
modal.find('.modal-content').load(url);
});
@Danielku15
Danielku15 / Example.html
Created February 25, 2016 19:53
A MediaTypeFormatter for WebApi for multipart/form-data including file uploads
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>File Upload example</title>
<link href="/Content/bootstrap.css" rel="stylesheet" />
</head>
<body>
<form action="api/Upload" method="post">
<div class="form-group">
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 8, 2024 17:50
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Saanch
Saanch / structuremap.owin
Created July 16, 2015 01:41
structuremap OWIN middleware to handle the container per owin context
StructureMapOWINMiddleware in remplacement of the IHttpModule :
//basic draft
public class StructureMapOWINMiddleware : OwinMiddleware
{
public StructureMapOWINMiddleware(OwinMiddleware next)
: base(next)
{
}
@meziantou
meziantou / WebFormsBootstrapValidation.aspx
Last active May 27, 2023 11:29
ASP.NET WebForms Validators & Bootstrap
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ASP.NET WebForms Validators & Bootstrap</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css" />
@GrantByrne
GrantByrne / UserValidator.cs
Created April 24, 2014 06:02
Using Fluent Validation with WPF - Dead Simple
using System.Text.RegularExpressions;
using FluentValidation;
using WpfFluentValidationExample.ViewModels;
namespace WpfFluentValidationExample.Lib
{
public class UserValidator : AbstractValidator<UserViewModel>
{
public UserValidator()
{
@cbskgc
cbskgc / InsertionModeReplaceWithExample.cshtml
Created February 16, 2014 22:50
Supporting ReplaceWith for AjaxOption.InsertionMode: It is occasionally convenient to be able to update content including the target container. This avoids a separate container to wrap the partial view statement.
@{
var ajaxOptions = new AjaxOptions { UpdateTargetId = "form" };
var htmlAttributes = new { id = "form", data_ajax_mode = "replacewith" };
}
@using (Ajax.BeginForm("Index", null, ajaxOptions, htmlAttributes))
{
}