Skip to content

Instantly share code, notes, and snippets.

View Eonasdan's full-sized avatar

Eonasdan Eonasdan

View GitHub Profile
@Eonasdan
Eonasdan / Model.cs
Last active September 30, 2022 12:37
MVC EditorFor Template for Datetimepicker
using System.ComponentModel.DataAnnotations;
[DataType(DataType.Time)]
public DateTime Updated { get; set; }
@Eonasdan
Eonasdan / ReSharper Magic Tricks - Live Templates.dotSettings
Last active March 9, 2018 13:03
My Exported Custom Live Templates, Structural Search and Replace and Code Inspectors for ReSharper. See my blog post: http://www.eonasdan.com/home/resharper-magic-tricks. To import these settings, save the file, open VS, ReSharper Menu, Manage Options, Import from File. You can also import from the raw git
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=14EE3F794AD14C4CB6DD37A9E2006F57/@KeyIndexDefined">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=14EE3F794AD14C4CB6DD37A9E2006F57/Applicability/=Live/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=14EE3F794AD14C4CB6DD37A9E2006F57/Reformat/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=14EE3F794AD14C4CB6DD37A9E2006F57/Shortcut/@EntryValue">ajax</s:String>
<s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=14EE3F794AD14C4CB6DD37A9E2006F57/ShortenQualifiedReferences/@EntryValue">True</s:
@Eonasdan
Eonasdan / removeWin10Apps.ps1
Created September 4, 2015 14:58
Remove annoying windows 10 store apps you can't uninstall. this is a powershell script to for uninstall win 10 built in apps that run for no reason. It also appears that MS will force some/all of them back after a windows update. From http://www.howtogeek.com/224798/how-to-uninstall-windows-10s-built-in-apps-and-how-to-reinstall-them/
# Uninstall 3D Builder:
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
# Uninstall Alarms and Clock:
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
# Uninstall Calculator:
Get-AppxPackage *windowscalculator* | Remove-AppxPackage
# Uninstall Calendar and Mail:
@Eonasdan
Eonasdan / MinecraftSounds.java
Created October 28, 2015 21:33
strongly typed class file of Minecraft default sounds
public class MinecraftSounds {
public static String AmbientCaveCave = "ambient.cave.cave";
public static String AmbientWeatherRain = "ambient.weather.rain";
public static String AmbientWeatherThunder = "ambient.weather.thunder";
public static String GamePlayerHurtFallBig = "game.player.hurt.fall.big";
public static String GamePlayerHurtFallSmall = "game.player.hurt.fall.small";
public static String GameNeutralHurtFallBig = "game.neutral.hurt.fall.big";
public static String GameNeutralHurtFallSmall = "game.neutral.hurt.fall.small";
public static String GameHostileHurtFallBig = "game.hostile.hurt.fall.big";
public static String GameHostileHurtFallSmall = "game.hostile.hurt.fall.small";
@Eonasdan
Eonasdan / gist:4ade9cad3755ff62fd80
Last active August 29, 2019 13:46
zensharp tempaltes
// C# templates
// Sample file
space ::= " "
cursor ::= "$END$"
cursorb ::= "(" cursor ")"
// Resharper macros:
identifier ::= <name default="$name$" macros = "complete()">
identifier2 ::= <name2 default="$name2$" macros = "complete()">
//
@Eonasdan
Eonasdan / Routing-Areas.tt
Last active April 3, 2016 20:14
Creates a strongly typed MVC urls: see http://vikutech.blogspot.com/2014/11/strong-typed-mvc-routing-on.html. Routing-Areas.tt is an enhancement to the original attempting to check if the route is in a Area. Routing-JsonResults.tt limits the generation to JsonResult Actions
<#@ template debug="true" hostSpecific="true" #>
<#@ assembly name="System.Core" #>
<#@ Assembly Name="EnvDTE" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".ts" #>
module Routing {
<#
@Eonasdan
Eonasdan / Amazon Book to public library search.md
Last active January 17, 2018 21:28
Search local public libraries from Amazon using these Bookmarklets

Amazon Book to public library search

image

Each of the sections below allow you to click on a bookmark/favorite to quickly search your local public library for a book you are looking at on Amazon. The goal is to save money (and bookshelf clutter :)) so you can check out a book (see what I did there?) instead of buying it first.

##Quick Guide

Here's how you use these. It's probably going to be easiest to copy the bookmarklet code by clicking "Raw":

@Eonasdan
Eonasdan / A generic repository.md
Last active July 11, 2022 06:03
This is my attempt at a very flexible generic repository for an n-layer MVC project.

Generic Repo

This is my attempt at a very flexible generic repository for an n-layer MVC project.

IRepository

I've got this placed in my business/service layer which any DAL (Data Access Layer) project can reference and implement.

PagedEntities

@Eonasdan
Eonasdan / css steal.html
Created September 26, 2016 19:27
CSS Steal
<script>
(function () {
var CSSSteal = function () {
var api = {}, html = null, styles = [], indent = ' ', elements = false, args = arguments;
var requirements = function () {
if (args.length === 0) {
throw new Error('CSSSteal expects at least one argument (DOM element)');
}
@Eonasdan
Eonasdan / Packages XML to C# paste
Created December 31, 2016 04:06
parsing package.config for nuget package explorer
/// <remarks/>
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class packages
{
private packagesPackage[] packageField;