Visual Studio 2012 - Change themes
Install the Color Theme editor extension to get the blue theme back in Visual Studio 2012, and turn off the upper case menu.
Articles, code snippets and news worth sharing.
Install the Color Theme editor extension to get the blue theme back in Visual Studio 2012, and turn off the upper case menu.
Replace all b tags with strong tags in C# using a lazy regular expression that also works across line breaks.
<b>This is a bold text</b> Lorem Ipsum is simply dummy text
<b>some more bold text</b>
Lorem Ipsum is simply dummy text <b> again bold text </b>Windows Store apps have no config file. Use ApplicationData.Current.LocalSettings to save and read app settings in C#.
using Windows.Storage;
bool SaveSettings(string key, string value)
{
try
{A PowerShell script that empties a SharePoint 2010 document library by deleting its files and then its folders.
Add-PSSnapin Microsoft.SharePoint.PowerShell
# Replace siteurl with actual web url
$web = Get-SPWeb -Identity "siteurl"
# Replace docurl with document library url
$list = $web.GetList("docurl")Reassign an existing SharePoint 2010 workflow task to a different user with SPWorkflowTask.AlterTask.
using (SPSite site = new SPSite("http://myteamsite:2012/"))
{
using (SPWeb web = site.OpenWeb())
{
SPUser user = web.SiteUsers["myad\\administrator"];
SPListItem taskItem = web.Lists["Shared Documents"].Items[0];Look the function up on window using its name, check it is a function, then call it with apply.
var functiontocall = "HelloWorld";
var fn = window[functiontocall];
if (typeof fn !== 'function')
return;
var retvalue = fn.apply(window, ["Amal Hashim"]);XSLT 1.0 has no ends-with function, so compare the last characters of the string with substring.
<xsl:when test="substring($url, string-length($url) - 3) = '.pdf'">Use one advanced setting on the document library to keep its items out of search results.
Replace the XSL of the Search Core Results web part to see the raw XML, so you can tell search problems from XSLT problems.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>
</xsl:template>
</xsl:stylesheet>Fix a SharePoint 2010 solution deployment stuck on Deploying by restarting the admin service and running the pending admin jobs.
stsadm -o execadmsvcjobsHandle exceptions in JavaScript with try, catch and finally, and catch everything else with window.onerror.
try {
// Code block
}
catch (e) {
// Handle exception
}Two small functions that encode and decode HTML characters by letting jQuery and the browser do the work.