Skip to content

Instantly share code, notes, and snippets.

View mmhantea's full-sized avatar
😎

Mihaita Hantea mmhantea

😎
View GitHub Profile
@mmhantea
mmhantea / .bash_profile
Created October 6, 2016 21:23 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@mmhantea
mmhantea / DelegatedList.cs
Created March 16, 2016 09:18 — forked from Lionhunter3k/DelegatedList.cs
grouped collection
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.UI.Xaml.Data;
@mmhantea
mmhantea / RelayCommand.cs
Created June 9, 2015 11:12
RelayCommand implementation
/// <summary>
/// A command whose sole purpose is to
/// relay its functionality to other
/// objects by invoking delegates. The
/// default return value for the CanExecute
/// method is 'true'.
/// </summary>
public class RelayCommand<T> : ICommand
{
#region Constructors
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
namespace Mvc
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using Humanizer;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
@mmhantea
mmhantea / AsyncDelegateCommand.cs
Created June 26, 2014 12:38
AsyncDelegateCommand
public class AsyncDelegateCommand : ICommand
{
protected readonly Predicate<object> _canExecute;
protected Func<object, Task> _asyncExecute;
public event EventHandler CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
@mmhantea
mmhantea / dicomdir
Created March 18, 2014 07:30
dicomdir with fo-dicom
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dicom.Data;
using Dicom;
namespace gatewayservice
{
@mmhantea
mmhantea / EnhancedEnum
Created March 18, 2014 02:03
EnhancedEnum
#region Base Abstract Class
public abstract class EnumBaseType<T> where T : EnumBaseType<T>
{
protected static List<T> enumValues = new List<T>();
public readonly string Key;
public readonly int Value;
public readonly int Diameter;
@mmhantea
mmhantea / CustomWindow
Created October 21, 2013 05:06
CustomWindow : Preserves windows settings Top, Left, Width, Height on one or extended screen.
using System.ComponentModel;
using System.Windows;
/// <summary>
/// Preserve windows settings: Top, Left, Width, Height on one or extended screen.
/// </summary>
public class BaseWindow : Window
{
#region Private Fields
@mmhantea
mmhantea / EnhancedDataGrid
Last active December 26, 2015 02:29
Custom DataGrid preserving its column settings.Initial source http://bengribaudo.com/blog/2012/03/14/1942/saving-restoring-wpf-datagrid-columns-size-sorting-and-orderUpdated code to add a context menu and chose column visibility
/// <summary>
/// DataGrid preserving its column settings
/// Initial source http://bengribaudo.com/blog/2012/03/14/1942/saving-restoring-wpf-datagrid-columns-size-sorting-and-order
/// Updated code to add a context menu and choose column visibility
/// </summary>
public class EnhancedDataGrid : DataGrid
{
#region Private fields
private bool _inWidthChange;