Skip to content

Instantly share code, notes, and snippets.

Paul T. purtuga

Block or report user

Report or block purtuga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@purtuga
purtuga / bookmarklet-post-with-buffer.js
Created Jun 4, 2018
Post with Buffer by opening a new window to the buffer add page
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);
@purtuga
purtuga / ie.aspx
Last active Jan 11, 2019
SharePoint file that forces IE into EDGE mode and load a given aspx page in an iframe. See http://wp.me/p2kCXW-95
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).
@purtuga
purtuga / grunt.copy.onlyNew.js
Last active Aug 29, 2015
A grunt-copy task filter option function. Enables the copying of only changed files to the destination.
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
@purtuga
purtuga / grunt.copy.includeFile.js
Last active Mar 10, 2019
A Grunt Copy process function to embed content of files into other files.
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
@purtuga
purtuga / spservices.forum.444799.test.aspx
Created Oct 25, 2014
SPServices test file - forum post 444799
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>
@purtuga
purtuga / jQuery.SPGetListItemInfoByUrl.js
Last active Aug 29, 2015
Sharepoint WebServices utlity to retrieve information about a List (or Document Library) item based on its URL.
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)]
@purtuga
purtuga / jQuery.doWhen.js
Created Jan 4, 2014
A jQuery utility leveraging the Deferred Class to execute a code block in the future after a given condition is meet. See blog post for more: http://wp.me/p2kCXW-35
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
@purtuga
purtuga / jquery.SPWidgets.js
Last active Dec 27, 2015
Proposed fix to Issue #9 of SPWidgets
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}
You can’t perform that action at this time.