Skip to content

Instantly share code, notes, and snippets.

View javafun's full-sized avatar

Vincent javafun

View GitHub Profile
@rarous
rarous / Blackboard-vs2010
Created March 23, 2010 09:12
Blackboard Theme for VS 2010
<UserSettings>
<ApplicationIdentity version="10.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Database Tools" RegisteredName="Database Tools"/>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
public class InMemoryDbSet<T> : IDbSet<T> where T : class
{
readonly HashSet<T> _set;
readonly IQueryable<T> _queryableSet;
public InMemoryDbSet() : this(Enumerable.Empty<T>()) { }
public InMemoryDbSet(IEnumerable<T> entities) {
@tenken
tenken / shortprofile.info
Created March 29, 2012 22:17
A Sample short profile that auto-fills the DB form, its a little ugly.
; dpg ::: http://drupal.org/user/1059226
; Example Short Profile -- hides database configuration page.
;
; This bears mentioning more than once. See http://drupal.org/node/1153646
name = Short Profile
description = A short profile, it removes DB settings page.
core = 7.x
dependencies[] = block
@jstemerdink
jstemerdink / ImageFile.cs
Last active April 3, 2017 02:05
Tag your images by using the Microsoft Computer Vision API.
using System.ComponentModel.DataAnnotations;
using Episerver.Playground10.Models.Properties;
using EPiServer.Core;
using EPiServer.DataAnnotations;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Web;
[ContentType(GUID = "0A89E464-56D4-449F-AEA8-2BF774AB8730")]
@nzpcmad
nzpcmad / AssignOAuth2SecurityRequirements.cs
Last active June 27, 2017 12:54
Using Swagger for Implicit Grant on Azure AD
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Swashbuckle;
using Swashbuckle.Swagger;
using System.Web.Http.Description;
namespace TodoListService
@nzpcmad
nzpcmad / gist:2f274f5ca2d93a6f37e06ef610259db2
Created November 8, 2016 19:12
Postman : Authorisation Code Grant on Server 2016 - ADFS 4.0 - with template web API
{
"variables": [],
"info": {
"name": "ADFS My IIS",
"_postman_id": "f2145f47-b93d-b35a-5707-c115e866bf2b",
"description": "Auth code flow.",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@javafun
javafun / Install Solr.ps1
Last active May 13, 2018 08:59 — forked from kamsar/Install Solr.ps1
Sitecore Solr Cannon
# This script will set up (and install if needed) Apache Solr for a Sitecore instance.
# This does NOT configure Sitecore to use Solr,
# just the Solr server and cores for Sitecore to connect to once it is set up to use Solr.
# So, what does it do?
#
# * Installs SOLR, if needed, from the Bitnami SOLR stack: https://bitnami.com/stack/solr/installer
# * Creates a SOLR config set for the cores to share (shared schema)
# * Creates SOLR cores for all Sitecore indexes, including secondary cores to support online reindexing (Switch on Rebuild)
@mackuba
mackuba / macbook-pro-2016.md
Created January 18, 2017 03:06
MacBook Pro 2016 - an iOS developer's review

MacBook Pro 2016 - an iOS developer's review

Here are some thoughts about my new MacBook Pro that I've been using for the last few weeks (the Santa Claus from DHL brought it to me just before Christmas), hopefully this will help someone who's considering getting one.

Note: this is written from the perspective of a person who switched to the MBP from a 2015 13" MacBook Air (i7) and also has a 2012 21" iMac. Your experiences will obviously be different if you have e.g. a fairly recent 15" Retina MacBook Pro.

Specs

  • MacBook Pro 15", late 2016
  • Core i7 2.9 GHz (4 cores)
@akshaysura
akshaysura / HabitatSolutionScript.ps1
Created January 21, 2017 23:34
Create a Sitecore Helix solution from scratch using PowerShell
#paths to the project templates on your system
$global:classTemplate = "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplatesCache\CSharp\Windows Root\Windows\1033\ClassLibrary\csClassLibrary.vstemplate"
$global:webTemplate = "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplatesCache\CSharp\Web\1033\WebApplicationProject40\EmptyWebApplicationProject40.vstemplate"
#variable used to store the path for the empty Habitat folder
$global:helixPath =""
#empty variable used to store the solution name
$global:solutionName = ""
@JimBobSquarePants
JimBobSquarePants / CamelCase.cs
Last active January 5, 2019 09:55
Maps an instance of IPublishedContent to a strong typed Model. This would allow you to use models in your views and save logic. In your controller you should be able to use var MyModel = ModelMapper.Map<Type>(renderModel.Content); This could easily be turned into an extension method IPublishedContent. Based on the MVC separation article by Nick …
namespace UmbracoBootstrap.Infrastructure.Extensions
{
#region Using
using System.Diagnostics.CodeAnalysis;
#endregion
/// <summary>
/// Encapsulates a series of time saving extension methods to <see cref="T:System.String">String</see>s.
/// </summary>
public static class StringExtensions