Skip to content

Instantly share code, notes, and snippets.

@iOnline247
iOnline247 / robot.js
Created December 3, 2012 17:20
W00t #1 YEAH!!!! (Zolmesiter)
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
//robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
// Example itemUrl for Document:
// http://<site>/<DocLib>/doc7.docx
// Example itemUrl for Item:
// http://<site>/<customsite>/Lists/<ListName>/<ID>_.000
function fireWorkflow ( itemUrl, workflowName, workflowParams ) {
workflowParams = workflowParams || "<root />";
$().SPServices({
@iOnline247
iOnline247 / SPServices.StartWorkflow
Created February 19, 2014 19:02
SPServices.StartWorkflow
$.fn.SPServices.StartWorkflow = function(options) {
var opt = $.extend({}, {
itemUrl: null,
workflowName: null,
workflowParameters: "<root />",
completefunc: null, // Function to call on completion of rendering the change.
debug: false // If true, show error messages;if false, run silent
}, options),
thisFunction = "SPServices.StartWorkflow",
@iOnline247
iOnline247 / JSOM_BCS
Last active August 29, 2015 13:59
JSOM Paging and BCS
var $1_10_2 = jQuery.noConflict();
(function( $, undefined ) {
var $formTable = null,
results = [],
queryPosition = null
;
// Why wait for the DOM to be ready?
ExecuteOrDelayUntilScriptLoaded($.noop, "sp.js");
var $1_10_2 = jQuery.noConflict();
(function( $, undefined ) {
var $formTable = null,
results = [],
queryPosition = null
;
// Why wait for the DOM to be ready to download sp.js?
ExecuteOrDelayUntilScriptLoaded($.noop, "sp.js");
jQuery.ajax({
type: "GET",
url: "/sites/siteName/_vti_bin/ExcelRest.aspx/listName/Vendors.xlsx/OData/Table1?$inlinecount=allpages",
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": __REQUESTDIGEST.value
}
})
.done(function(data, status) {
console.dir(data);
var $1_10_2 = jQuery.noConflict();
(function( $, undefined ) {
var results = []
;
retrieveListItems();
function retrieveListItems() {
var cachedItems = JSON.parse(localStorage.getItem("pl-Vendors"));
@iOnline247
iOnline247 / Create-Files-Folders.ps1
Created March 28, 2015 18:18
Create 21,000 folders and 21,000 files for funsies
# Create 21,000 folders and 21,000 txt files.
# Add one file per folder.
# Folder names will be sequential.
# File names will start with a GUID and end with a timestamp.
# This is to try and prove if ODB is FIFO and not any other way.
param(
[parameter(mandatory=$true)]
[string]$filePath
)
@iOnline247
iOnline247 / $sp.wf.js
Last active March 20, 2019 19:16
Use this to fire list workflows by name or subscriptionId.
/*!
* Created by Matthew Bramer
* Released under the MIT license
* Date: 2015-04-18
* Props to: http://plumsail.com/blog/2015/02/start-sharepoint-2013-workflows-selected-items/
* Tested using SharePoint Online.
* On-Prem still needs testing.
*/
window.$sp = window.$sp || {};
@iOnline247
iOnline247 / $sp.ca.js
Last active May 12, 2023 13:01
Create/Delete Custom Actions in SharePoint
/*!
* Created by Matthew Bramer :: @iOnline247
* Released under the MIT license
* Date: 2016-02-12 v1
* Inspired from script written on: 2014-05-17
* https://dl.dropboxusercontent.com/u/21583725/demos/SPSDC-ModalMania/demo/js/iframeDemo.js
* Tested using SharePoint Online.
*
* Helpful Links
* https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomActionRequestExamples