Skip to content

Instantly share code, notes, and snippets.

View mahizsas's full-sized avatar

MAHIZ mahizsas

View GitHub Profile
namespace Radar.Common.WebServer.Api.Controllers
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
@mahizsas
mahizsas / change_language.txt
Created May 17, 2013 08:00
Change Language in keyboards for MS-Dos-Edit
REM: EOF in C:\Windows\System32\config.nt
COUNTRY=039,850,C:\Windows\System32\COUNTRY.SYS
REM: EOF in C:\Windows\System32\autoexec.nt
C:\Windows\System32\KB16 IT,850,C:\Windows\System32\KEYBOARD.SYS
@mahizsas
mahizsas / bootstrap-validation.js
Created May 21, 2013 05:28 — forked from ijason/bootstrap-validation.js
Validatin sito Boostrap
$(function () {
$('span.field-validation-valid, span.field-validation-error').each(function () {
$(this).addClass('help-inline');
});
$('.validation-summary-errors').each(function () {
$(this).addClass('alert');
$(this).addClass('alert-error');
$(this).addClass('alert-block');
});
@mahizsas
mahizsas / backup.sql
Created May 26, 2013 09:48
Backup / Restore all USERS databases
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory
SET @path = 'C:\Backups\'
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//Extra ignores to support WCF in ASP.NET MVC
routes.IgnoreRoute("{resource}.svc/{*pathInfo}");
routes.IgnoreRoute("{resource}.svc");
routes.MapRoute(
name: "Default",
var query = from order in context.Orders
group order by new { order.Customer , order.OrderDate } into ordersForCustomer
select
new
{
Key1 = ordersForCustomer.Key.Customer,
Key2=ordersForCustomer.Key.OrderDate,
Count=ordersForCustomer.Count()
};
var chartData = from log in _contextProvider.Context.Logs
group log by new
{
ApplicationName=log.Application.Name,
Year= SqlFunctions.DatePart("Year", log.Timestamp),
Month= SqlFunctions.DatePart("Month",log.Timestamp)
}
into logsPerApplication
select new
{
@mahizsas
mahizsas / MimeHelpers.cs
Last active December 1, 2024 04:37
MimeTypes list
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
namespace MimeHelpers
{
internal static class Mime
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EntityExtensions {
public class FakeDbSet<T> : System.Data.Entity.IDbSet<T> where T : class {
private readonly List<T> list = new List<T>();
public FakeDbSet() {
using System;
using System.Collections.Generic;
using System.Linq;
using Nancy.ModelBinding;
public class DynamicModelBinder : IModelBinder
{
public object Bind(NancyContext context, Type modelType, object instance, BindingConfig configuration, params string[] blackList)
{
var data =