Skip to content

Instantly share code, notes, and snippets.

View sionjlewis's full-sized avatar

Siôn J. Lewis sionjlewis

View GitHub Profile
@sionjlewis
sionjlewis / Checkbox List with Knockout JS.markdown
Last active August 29, 2015 14:22
Checkbox List with Knockout JS

Checkbox List with Knockout JS ('-' * 30) Uses Knockout JS to populate and checkbox list. This has been crafted with SharePoint in mind as the data source(s). This example demonstrated the observable array being updated by checkboxes. It does this by simply updating the text displayed by the textbox.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Prepend zeroes to a number.markdown
Last active August 29, 2015 14:22
Prepend zeroes to a number

Prepend zeroes to a number ('-' * 26) Using JavaScript to prepend zeroes to a number, for example: 0005 instead of 5 or Using JavaScript to prepend zeroes to a number, for example: 0099 instead of 99.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Knockout JS with Mapping Plug-in.markdown
Last active August 29, 2015 14:22
Knockout JS with Mapping Plug-in

Knockout JS with Mapping Plug-in ('-' * 32) This example demonstrates how to apply the ko.mapping plugin to a plain JavaScript object and include it an existing ko view model object.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Trim text to the nearest space....markdown
Last active August 29, 2015 14:22
Trim text to the nearest space...

Trim text to the nearest space... ('-' * 33) Demos a custom function called trimText(), which trims text to the nearest space just before the 50 character length and so avoiding odd characters just before the...

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / RSS Feed JQuery Test.markdown
Last active August 29, 2015 14:22
RSS Feed JQuery Test

RSS Feed JQuery Test ('-' * 20) x4 examples: RSS Feed display within web page using JQuery with and without the jquery-rss plugin.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Cascading DropDown List Controls V3.markdown
Last active August 29, 2015 14:22
Cascading DropDown List Controls V3

Cascading DropDown List Controls V3 ('-' * 35) Uses Knockout JS to populate and control a pair for cascading drop-down lists. This has been crafted with SharePoint in mind as the data source(s). This example disables the 2nd drop-down list if the first control has not been selected.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Cascading DropDown List Controls V2.markdown
Last active August 29, 2015 14:22
Cascading DropDown List Controls V2

Cascading DropDown List Controls V2 ('-' * 35) Uses Knockout JS to populate and control a pair for cascading drop-down lists. Uses Knockout JS to populate and control a pair for cascading drop-down lists. This has been crafted with SharePoint in mind as the data source(s). This example disables the 2nd drop-down list if the first control has not been selected.

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / Test Cross-Origin Requests.markdown
Last active August 29, 2015 14:22
Test Cross-Origin Requests

Test Cross-Origin Requests ('-' * 26) ...Using CORS, a server can explicitly allow some cross-origin requests while rejecting others. CORS is safer and more flexible than earlier techniques such as JSONP...

A Pen by Siôn J. Lewis on CodePen.

License.

@sionjlewis
sionjlewis / RSS Cross-Origin Request using an AJAX promise.markdown
Last active August 29, 2015 14:22
RSS Cross-Origin Request using an AJAX promise

RSS Cross-Origin Request using an AJAX promise ('-' * 46) Cross-Origin RSS Feed requested with AJAX and a JQuery Promise. This example requires a Web Service with CORS enabled.

A Pen by Siôn J. Lewis on CodePen.

License.