Skip to content

Instantly share code, notes, and snippets.

View blacktambourine's full-sized avatar

Black Tambourine blacktambourine

View GitHub Profile
@blacktambourine
blacktambourine / RadEditor.Dialogs.resx
Created January 4, 2016 06:15
Telerik Rad Editor Missing Labels Fix
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
@blacktambourine
blacktambourine / install.ps1
Created January 14, 2016 04:39
Nuget Powershell to Set CopyLocal to false for dlls
param($installPath, $toolsPath, $package, $project)
$asms = $package.AssemblyReferences | %{$_.Name}
$configName = $project.ConfigurationManager.ActiveConfiguration.ConfigurationName
Write-Host "Updating dlls for configuration - ${configName}";
if ($configName -NotLike "*CD")
{
Write-Host "Updating dlls for Non-CD (Content Delivery) Environment";
@blacktambourine
blacktambourine / services.js
Created March 16, 2016 03:18
Angular JS Services
var corpServices = angular.module('corpApp.corpServices', ['ngResource']);
(function ()
{
//#region Common Service Methods
var serviceRootPath = '/api/';
//add anti-forgery token to all Authenticated GET and POST requests
var AntiForgeryRequest = function (enableCache)
{
@blacktambourine
blacktambourine / base_controller.js
Last active March 16, 2016 07:13
Base Controller
var baseModule = angular.module('corpApp.baseModule', ['ngRoute']);
baseModule.controller('BaseCtrl', ['$scope', '$q', '$timeout', function ($scope, $q, $timeout)
{
//#region Initialise variables
$scope.pageErrors = {};
$scope.data = {};
@blacktambourine
blacktambourine / example_angular_controller.js
Created March 16, 2016 07:20
example angular controller
var accordionModule = angular.module('corpApp.accordionContentModule', ['ngRoute']);
accordionModule.controller('AccordionContentCtrl', ['$scope', '$controller', 'AccordionContentService', function ($scope, $controller, AccordionContentService) {
$scope.populatePageData = function (itemId)
{
$scope.callWebApiService(AccordionContentService, { id: itemId })
.then(function (result)
{
$scope.HandleResponseErrors(result);
using System;
using System.Collections.Generic;
using System.Web.Http;
using System.Web.Http.Description;
using MyProject.Web.Models.Common;
using NLog;
namespace MyProject.Web.WebApi
{
public class DemoController : ApiController
@blacktambourine
blacktambourine / parametersobject.js
Created March 16, 2016 07:44
Parameter Mapping in Angular//
$scope.callWebApiService(SearchService,
{
Keywords: searchData.keywords,
CategoryPaths: searchData.categoryPaths,
SubCategoryPaths: searchData.subCategoryPaths,
Types: searchData.types,
CurrentPage: $scope.pager.currentPage,
DateFrom: $scope.dateFrom,
DateTo: $scope.dateTo
})
@blacktambourine
blacktambourine / PostExample.js
Created March 16, 2016 07:58
Angular JS Post to Web API
contactModule.controller('QuoteRequestController', ['$scope', '$q', '$timeout', 'QuoteRequestService', function ($scope, $q, $timeout, QuoteRequestService)
{
$scope.saveData = new QuoteRequestService();
$scope.saveData.Title = "my string value";
$scope.saveData.$save(function ()
{
//do something after save
});
}]);
@blacktambourine
blacktambourine / Token.aspx
Created March 17, 2016 09:03
Add an Anti Forgery Token
<%= AntiForgery.GetHtml() %>
@blacktambourine
blacktambourine / schema.xml
Created June 14, 2016 02:07
SOLR schema.xml post Sitecore generation (Sitecore 8.1 Update 3 and SOLR 5.5)
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0