Skip to content

Instantly share code, notes, and snippets.

View mutuadavid93's full-sized avatar
🎯
Focusing

David Mutua mutuadavid93

🎯
Focusing
  • Squad Africa
  • NAIROBI
View GitHub Profile
/*
When looping Multiple items from a SharePoint List
and You want to render them on UI into individual rows
containing only a specific number of columns. :)
*/
$(function() {
var $render = function (myarr){
console.dir(myarr); // rendering logic.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<!--
1. The best Idea is that the File Even when Updating other items,
will be overwritten, so no need to worry about the update code.
:)
-->
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
//your code goes here...
<div id="message"></div>
/*
Get a SharePoint List Metadata for Use in REST API code.
1. Create a List and Add one item into it.
2. Create a SitePage and Insert a Script Editor into it.
3. Edit the WebPart to insert the code below inside.
4. Save the File.
5. Open Fiddler and inspect the Data from JSON tab.
6. You are good.
*/
// Dynamic Image Slider for SharePoint
// Image Carousel
// SharePoint Image Slider
$(document).ready(function () {
// ### Fecth Data from The List
var resourcez = "/_api/web/lists/GetByTitle('SlideMagic')/items?$select=Title,EncodedAbsUrl,Description,Alive";
//var eureka = "$top=3";
var orient = "$orderby=Created desc";
// ## Add a ScrollBar to a Page using jQuery
// ## Add a ScrollBar to an Element using jQuery
// ## Add a ScrollBar to a Div using javascript
// ## Add a ScrollBar to a SharePoint Master Pages using jQuery
// ## START Adding a ScrollBar on PAGE
// Get the Open Window Height then Compare it to Parent Div height
if ($('div#ms-designer-ribbon').html()) {
//Don't Show ScrollBar
// How to Create a React Sub Component
a. Create File
b. Import React Library
c. Use createClass() to Define the Component
d. Export Component
var React = require('react'),
// Add data into a list using CSOM
function apbObjectivesSection() {
alert("We are in the first function");
var currentCrx = SP.ClientContext.get_current();
var web = currentCrx.get_web();
try {
var list = web.get_lists().getByTitle("MyObjectives");
var itemInfoObj = new SP.ListItemCreationInformation();
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
gulpif = require('gulp-if'),
gutil = require('gulp-util'),
browserify = require('gulp-browserify'),
compass = require('gulp-compass'),
htmlmin = require('gulp-htmlmin'),
cssmin = require('gulp-minify-css'),
connect = require('gulp-connect');
/*
* Demonstarting function callbacks
*/
function foo(Goon) {
console.warn("Hello from: "+Goon);
}
function galon(company){
console.log("Greatings from: "+company);
}