Skip to content

Instantly share code, notes, and snippets.

View DWboutin's full-sized avatar
🎯
Focusing

Mike Boutin DWboutin

🎯
Focusing
  • Quebec city
View GitHub Profile
@DWboutin
DWboutin / latinise-string.js
Last active August 29, 2015 14:16
Latinise string
//http://semplicewebsites.com/removing-accents-javascript
var Latinise={};Latinise.latin_map={"Á":"A","Ă":"A","Ắ":"A","Ặ":"A","Ằ":"A","Ẳ":"A","Ẵ":"A","Ǎ":"A","Â":"A","Ấ":"A","Ậ":"A","Ầ":"A","Ẩ":"A","Ẫ":"A","Ä":"A","Ǟ":"A","Ȧ":"A","Ǡ":"A","Ạ":"A","Ȁ":"A","À":"A","Ả":"A","Ȃ":"A","Ā":"A","Ą":"A","Å":"A","Ǻ":"A","Ḁ":"A","Ⱥ":"A","Ã":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ḃ":"B","Ḅ":"B","Ɓ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ć":"C","Č":"C","Ç":"C","Ḉ":"C","Ĉ":"C","Ċ":"C","Ƈ":"C","Ȼ":"C","Ď":"D","Ḑ":"D","Ḓ":"D","Ḋ":"D","Ḍ":"D","Ɗ":"D","Ḏ":"D","Dz":"D","Dž":"D","Đ":"D","Ƌ":"D","DZ":"DZ","DŽ":"DZ","É":"E","Ĕ":"E","Ě":"E","Ȩ":"E","Ḝ":"E","Ê":"E","Ế":"E","Ệ":"E","Ề":"E","Ể":"E","Ễ":"E","Ḙ":"E","Ë":"E","Ė":"E","Ẹ":"E","Ȅ":"E","È":"E","Ẻ":"E","Ȇ":"E","Ē":"E","Ḗ":"E","Ḕ":"E","Ę":"E","Ɇ":"E","Ẽ":"E","Ḛ":"E","Ꝫ":"ET","Ḟ":"F","Ƒ":"F","Ǵ":"G","Ğ":"G","Ǧ":"G","Ģ":"G","Ĝ":"G","Ġ":"G","Ɠ":"G","Ḡ":"G","Ǥ":"G","Ḫ":"H","Ȟ":"H","Ḩ":"H","Ĥ":"H","Ⱨ":"H","Ḧ":"H","Ḣ":"H","Ḥ":"H","Ħ":"H","Í":"I","Ĭ":"
@DWboutin
DWboutin / name.aspx
Created April 21, 2015 15:56
Firstname and last name Sharepoint 2010
<SPSWC:ProfilePropertyLoader runat="server"></SPSWC:ProfilePropertyLoader>
<SPSWC:ProfilePropertyValue PropertyName="FirstName" runat="server"></SPSWC:ProfilePropertyValue>&nbsp;
<SPSWC:ProfilePropertyValue PropertyName="LastName" runat="server"></SPSWC:ProfilePropertyValue>
@DWboutin
DWboutin / base-url.js
Created May 12, 2015 15:38
Get the base url
var baseUrl = document.location.href.substr(0, document.location.href.indexOf('/', 8));
@DWboutin
DWboutin / SPQueryHandler.js
Last active August 29, 2015 14:21
Sharepoint 2010 Javascript CSOM
/* Usage http://allthatjs.com/2012/04/03/using-sharepoint-csom-in-html5-apps/
*
*
var SPQH = new SPQueryHandler('/intranet/ei/docei/conceptetfonctionnement');
SPQH.doWhenReady(function(){
// set operations here
SPQH.getPages();
});
*
*/
@DWboutin
DWboutin / app.js
Created June 9, 2015 14:51
require.js shims and stuff
require.config({
baseUrl: 'js/',
shim: {
myPlugin: {
deps: ['jquery']
},
jquery: {
exports: 'jQuery'
}
},
@DWboutin
DWboutin / meta-author.aspx
Created July 15, 2015 17:17
Editors meta informations Sharepoint 2010
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
<div id="pageMeta">
<d
@DWboutin
DWboutin / itemstyle.xslt
Created July 17, 2015 18:50
Base style for a XSL style template
<xsl:template name="ListeActualites" match="Row[@Style='ListeActualites']" mode="itemstyle">
<xsl:param name="CurPos" />
<xsl:param name="Last" />
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="Image">
@DWboutin
DWboutin / itemstyle.xslt
Created July 17, 2015 19:22
Display raw data from Content Query
<xsl:template name="DisplayRawData" match="Row[@Style='DisplayRawData']" mode="itemstyle">
<xsl:for-each select="@*">
<xsl:value-of select="name()" />
<xsl:text>
=
</xsl:text>
<xsl:value-of select="." />
<br />
</xsl:for-each>
</xsl:template>
@DWboutin
DWboutin / itemstyle.xslt
Created August 27, 2015 15:57
Get image thumbnail in XSLT
<xsl:variable name="URLimage">
<xsl:value-of select="substring-before(substring-after(@imageEvenement,'src=&#34;'),'&#34;')" />
</xsl:variable>
<xsl:variable name="ImgFilename">
<xsl:value-of select="substring-after($URLimage,'PublishingImages/')" />
</xsl:variable>
<xsl:variable name="URLThumb">
<xsl:value-of select="concat(substring-before($URLimage,$ImgFilename),'_t/',substring-before($ImgFilename,'.'),'_',substring-after($ImgFilename,'.'),'.',substring-after($ImgFilename,'.'))" />
</xsl:variable>
@DWboutin
DWboutin / itemstyle.xslt
Created August 28, 2015 19:25
Sharepoint 2010 format date french
<!-- mercredi 5 août 2015 -->
<xsl:value-of select="ddwrt:FormatDate(@Date, 1036, 3)" />