Instantly share code, notes, and snippets.

View bookmarklet-post-with-buffer.js
(function(encodeURI, DOCUMENT){
var link = DOCUMENT.createElement("a");
link.href="https://buffer.com/add?text=" + encodeURI(DOCUMENT.title) + "&url=" + DOCUMENT.location;
link.setAttribute("style", "position:absolute;left=-99999px;top:-99999px;visibility:hidden");
link.setAttribute("target", "_blank");
DOCUMENT.body.appendChild(link);
link.click();
setTimeout(function(){link.parentNode.removeChild(link);}, 10);
})(encodeURIComponent, document);
View ie.aspx
<!DOCTYPE html>
<html>
<head>
<!--
Set the IE rendering engine to EDGE and loads a given aspx file in an iframe,
thus forcing it to be rendered using the browser's latest rendering engine.
Usage: ie.aspx?file.aspx
The default page to be loaded, when this file is accessed, can be set below (url variable).
View grunt.copy.onlyNew.js
/**
* Returns a function that can be used with grunt's copy
* task 'filter' option. Checks if file being copied
* is newer than that destination file. A local file can be
* used as the "destination" timestampt - a useful method for
* when the destination file is really in a remote system
* (ex. linux server, or a WEBDav folder).
*
* @param {Array} target
* The grunt Copy configurtaion task that this instance
View grunt.copy.includeFile.js
/**
* includeFile() - embeds a file content within another. Meant to be
* used from the copy task as a 'processContent' function. The following
* tokens can be used in files: <br>
*
* - BUILD_INCLUDE('file')
* - /* BUILD_INCLUDE('file') *\x47
* - &lt;!-- BUILD_INCLUDE("file") --&gt;
*
* In addition, options can be added to the token above that further
View spservices.forum.444799.test.aspx
<%@ Page language="C#" MasterPageFile="~masterurl/default.master"
Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Register
Tagprefix="SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register
Tagprefix="Utilities"
Namespace="Microsoft.SharePoint.Utilities"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
View gist:9138272
<And>
<Neq>
<FieldRef Name='ID'/>
<Value Type='Counter'>0</Value>
</Neq>
</And>
<Or>
... Real filters here filters you want here ...
</Or>
</And>
View jQuery.SPGetListItemInfoByUrl.js
/**
* Given a URL to an item, this method will retrieve information about
* that URL, including the List UID and the ID of the item within the
* list.
*
* @param {Object|String} options
* An object with the options below or a string with the URL.
*
* @param {String} options.url
* @param {String} [options.webURL=(current site)]
View jQuery.doWhen.js
/*! Copyright (c) 2014 - Paul Tavares - purtuga - @paul_tavares - MIT License */
;(function($){
/**
* Delays the execution of a function until an expression returns true.
* The expression is checked every 100 milliseconds for as many tries
* as defined in in the attempts option
*
* @param {Object} options
* @param {Function} options.when
View jquery.SPWidgets.js
/**
* @fileOverview jquery.SPWidgets.js
* jQuery plugin offering multiple Sharepoint widgets that can be used
* for creating customized User Interfaces (UI).
*
* @version 20131106052852
* @author Paul Tavares, www.purtuga.com, paultavares.wordpress.com
* @see http://purtuga.github.com/SPWidgets/
*
* @requires jQuery.js {@link http://jquery.com}