Skip to content

Instantly share code, notes, and snippets.

View hazzik's full-sized avatar

Alex Zaytsev hazzik

  • Brisbane, Australia
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using DelegateDecompiler;
@{
var data = new RouteValueDictionary(ViewData);
object action;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("action", out action);
object controller;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("controller", out controller);
object area;
ViewData.ModelMetadata.AdditionalValues.TryGetValue("area", out area);
if (!string.IsNullOrEmpty((string) area))
{
module Jekyll
class TagCloudTag < Liquid::Tag
safe = true
def initialize(tag_name, text, tokens)
super
end
def render(context)
html = ""
using System;
using System.Diagnostics;
public class Class1
{
}
public class Test1
{
private const int iterations = 10000000;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Linq;
public static class Tests
{
private static readonly IDictionary<string, IList<long>> results = new Dictionary<string, IList<long>>();
@hazzik
hazzik / gist:cdec8b4c6863e7a33bc2
Created August 13, 2014 23:13
IISExpress.cmd
for /F %i in ('appcmd list sites /text:NAME') DO @appcmd delete site %i
@hazzik
hazzik / RestClient.cs
Created August 26, 2014 23:07
Simple dynamic REST client
public class RestClient : DynamicObject
{
private readonly string _address;
public RestClient(string address)
{
this._address = address;
}
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
[alias]
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
# BlogML import script originally sourced from:
# https://github.com/philippkueng/philippkueng.github.com/tree/30ef1570f06d33938b18d5eee7767d6641b9a779/source/_import
# Best post I could find about how to use it was here:
# http://philippkueng.ch/migrate-from-blogengine-dot-net-to-jekyll.html
#
# how to install
# --------------
# mkdir source/_importer
# cp blogml.rb to the source/_importer/ you created above
# cp your BlogML.xml to the same source/_importer/ directory
#! /bin/bash
# Assumes that you tag versions with the version number (e.g., "1.1")
# and then the build number is that plus the number of commits since
# the tag (e.g., "1.1.17")
DESCRIBE=`git describe --tags --always`
# increment the build number (ie 115 to 116)
VERSION=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[1]}'`