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 / 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 / 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 / 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 / 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.