Skip to content

Instantly share code, notes, and snippets.

@tiagoduarte
tiagoduarte / umbraco.config
Created September 24, 2016 13:14
umbraco proxy configuration
<system>
<defaultproxy>
<proxy bypassonlocal="True" proxyaddress="http://domain:port">
</proxy></defaultproxy>
</system>
@tiagoduarte
tiagoduarte / ContactFormPartial.cshtml
Last active September 24, 2016 13:08
umbraco contact form part 4
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ContactForm.Models.ContactModel>
<script src="http://ajax.aspnetcdn.com/ajax/mvc/4.0/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<style type="text/css">
.has-error{
color:red;
}
</style>
@tiagoduarte
tiagoduarte / ContactForm.cshtml
Last active September 24, 2016 13:07
umbraco contact form part 3
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "umbLayout.cshtml";
}
<div class="darkBg">
<div id="main-wrapper">
<div id="main" class="container">
<div class="row">
<div class="col-md-7 col-sm-12">
<div id="contactFom" class="row">
@tiagoduarte
tiagoduarte / ContactController.cs
Last active September 24, 2016 13:05
umbraco contact form part 2
using System.Configuration;
using System.Net.Configuration;
using System.Net.Mail;
using System.Text;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
using MailChimp;
using MailChimp.Lists;
namespace ContactForm.Controllers
@tiagoduarte
tiagoduarte / ContactModel.cs
Last active September 24, 2016 13:04
umbraco contact form part 1
using System.ComponentModel.DataAnnotations;
namespace ContactForm.Models
{
public class ContactModel
{
[Required]
[Display(Name = "First Name")]
public string FistName { get; set; }
[Required]
@tiagoduarte
tiagoduarte / Enable-Disable-Debugging.ps1
Created September 24, 2016 12:12
enable custom errors on all web applications of a sharepoint server
#summary
#this is a server side powershell script that enables and disables debugging on a sharepoint server
#note: if you have SP2013 with webapps/wsps in 2010 mode, you'll need to run $hive on 14 folder as well
#by tiago duarte @ 31-March-2015
#http://about.me/tiagoduarte
param(
#webUrl empty will parse all web applications
$enable = $true,
@tiagoduarte
tiagoduarte / entityeditor.ie9fix.js
Last active September 24, 2016 12:20
add sharepoint 2010 support for IE10+ (user picker fix)
function ConvertEntityToSpan(ctx, entity)
{ULSGjk:;
if(matches[ctx]==null)
matches[ctx]=new Array();
var key=entity.getAttribute("Key");
var displayText=entity.getAttribute("DisplayText");
var isResolved=entity.getAttribute("IsResolved");
var description=entity.getAttribute("Description");
var style='ms-entity-unresolved';
if(isResolved=='True')
@tiagoduarte
tiagoduarte / form.ie9fix.js
Last active June 30, 2023 14:58
add sharepoint 2010 support for IE10+ (form fix)
//the form.js functions don't play well in IE9 mode
//lets override and fix them
//console.log("loading form.ie9fix.js");
function RTE_GetEditorInstanceVariables(strBaseElementID)
{ULS1Lu:;
if (parent.g_oExtendedRichTextSupport !=null)
{
@tiagoduarte
tiagoduarte / tamper_monkey_spdevtools.js
Last active June 30, 2023 14:57
Adds new buttons near the ribbon for typical SharePoint actions
// ==UserScript==
// @name SharePoint Dev Tools
// @namespace TiagoDuarte
// @description Adds new buttons near the ribbon for typical SharePoint actions
// @version 3.7
// @grant none
// @match https://*.sharepoint.com/*
// ==/UserScript==
/*
@tiagoduarte
tiagoduarte / Convert-Online-Excel-To-Local-CSV.ps1
Last active November 14, 2015 15:32
Example that can, a) download a secure document and b) convert an excel to csv using local client application
#summary
#this script downloads an Excel document, saves it locally, and converts it to CSV
#by tiago duarte @ 15-sep-2015
#http://about.me/tiagoduarte
#set parameters for calling externally
param(
$xlsUrl = "http://mywebsite.com/mydocument.xlsx",