Skip to content

Instantly share code, notes, and snippets.

@JeffGos
JeffGos / gist:3eef4eb84451c9591897
Last active August 29, 2015 14:05
Knockoutjs observableArray with null properties in array items
<table>
<thead>
<tr>
<th>Name</th>
<th>Something that could be NULL</th>
</tr>
</thead>
<tbody data-bind="foreach: valuesArray">
<tr>
<td data-bind="text: Name"></td>
@JeffGos
JeffGos / gist:a4418b7e0116a22092c9
Created August 7, 2014 15:39
Knockoutjs add array of items to observableArray
ko.observableArray.fn.pushAll = function (valuesToPush) {
var underlyingArray = this();
this.valueWillMutate();
ko.utils.arrayPushAll(underlyingArray, valuesToPush);
this.valueHasMutated();
return this;
};
var viewModel = {
valuesArray : ko.observableArray([])
@JeffGos
JeffGos / ghost
Last active February 8, 2017 23:37
Centos init script for ghost blogging tool
#!/bin/sh
#
# ghost - run ghost blogging tool
#
# https://ghost.org/developers/
. /etc/rc.d/init.d/functions
ghosthome="/var/www/ghost/"
exec="/usr/bin/node index.js >> /var/www/ghost/ghost.log &"