Skip to content

Instantly share code, notes, and snippets.

View nzhul's full-sized avatar
Power Overwhelming!

Dobromir Ivanov nzhul

Power Overwhelming!
View GitHub Profile
@nzhul
nzhul / UsingAutomapper.cs
Last active August 29, 2015 14:25
This is an simple example of how one can use AutoMapper Library
using Models;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
namespace Data
{
public class UsersService
{
public ICollection<User> Users { get; set; }
--------------------------- THE MODEL --------------------------------------
public class DatePickerInputModel
{
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)]
public DateTime Date { get; set; }
}
------------------------------ APP START CONFIGURATION ----------------
Removing all deleted files: git ls-files --deleted -z | xargs -0 git rm
Removing deleted directory:
git rm -r --cached App/App.Web/DirectoryName
git commit -m 'Remove the now ignored directory "some-directory"'
git push
@nzhul
nzhul / CellularAutomata.cs
Last active November 11, 2015 12:31
Cellular automata - procedural cave generation
using System;
namespace CellularAutomata
{
class Program
{
static void Main(string[] args)
{
char key = new char();
MapHandler Map = new MapHandler();
using System;
using System.Net;
using System.Text;
using System.Threading;
namespace WebPageWatcher
{
public class Program
{
public static State state;
@nzhul
nzhul / Unity3DEventManager.cs
Created July 5, 2016 15:40
Pseudo code for Unity3d EventManager. Basically this is implementation of Observer pattern but with some twists for Unity3d
using System;
using System.Collections.Generic;
namespace EventManager
{
public class EventManager
{
private static EventManager instance = null;
public static EventManager Instance
{
@nzhul
nzhul / deleteBinariesFolders.ps1
Created November 8, 2016 07:54
Powershell script that can be used to delete all binary files recursively
param (
[string]$path = $(Read-Host "Path to folder")
)
$foldersToDelete = Get-ChildItem -Path $path -Recurse -Name "bin" -Directory | %{ Join-Path -Path $path -ChildPath $_.ToString() }
Remove-Item $foldersToDelete -Recurse -Confirm:$false
#Write-Host $foldersToDelete
------------- GenerateForumsSpamProtectionNuGetPackages.ps1 ---------------
[CmdletBinding()]
Param(
[alias("sln")]
$slnName = "Web.SitefinityModules.PublishingExtender",
[alias("slnDir")]
$slnDirectory = $null,
[alias("outDir")]
$outputDir = "C:\LEAN\local-nuget-repository",
[alias("projects")]
@nzhul
nzhul / Pagination.cshtml
Created February 23, 2017 12:04
Collapsing Pager
@using Web.Widgets.Search.Mvc.Models.View;
@model PagingData
<ul class="pagination">
@if (Model.DisplayPrev)
{
<li><a class="prev-page-url" href="@Model.PrevUrl">Previous</a></li>
}
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
namespace CorePlayground
{
public class Album
{