This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Condition represents the logical test which eventually is used to trigger | |
* an alarm (e.g. "out-of-comm", "temperature-below-freezing" etc.). This is a | |
* class, because a Condition can have parameters and it has to manage them. | |
*/ | |
abstract class AlarmCondition { | |
/** | |
* It can be in either "Up" state (good scenario) or "Down" state (bad scenario). | |
* By default (unless the constructor does something else), it starts as "Up". | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DialogButton { | |
YES = "yes", | |
NO = "no", | |
CANCEL = "cancel" | |
} | |
interface IDialog { | |
buttons: { [B in DialogButton]?: boolean }, | |
callback: (button: DialogButton) => void | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function _get(object, path, fallback) { | |
const value = path.split(".").reduce((hash, field) => hash && hash[field], object); | |
return typeof value === "undefined" ? fallback : value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin font($family, $file, $weight, $style, $locals) { | |
$prefix: "http://localhost:3000/fonts"; | |
$src: null; | |
@each $local in $locals { | |
$src: append($src, local($local), comma); | |
} | |
$src: append($src, url("#{$prefix}/#{$file}.eot?#iefix") format("embedded-opentype"), comma); | |
$src: append($src, url("#{$prefix}/#{$file}.woff2") format("woff2"), comma); | |
$src: append($src, url("#{$prefix}/#{$file}.woff") format("woff"), comma); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Main() { | |
Iterate { | |
IdentifyNextThread() | |
For each Thread { | |
PullThread() | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
identity: | |
company: DevFactory | |
version: 2.0 | |
# | |
# This document represents an L1 specification which describes in thorough | |
# technical detail a single Milestone; it can consist of a single file, or | |
# multiple files, imported via referencing. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
identity: | |
company: DevFactory | |
version: 2.0 | |
# | |
# This document represents an L1 specification which describes in thorough | |
# technical detail a single Milestone; it can consist of a single file, or | |
# multiple files, imported via referencing. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# | |
# Some pre-defined meta-values provided for this schema (required). | |
# | |
identity: | |
company: DevFactory | |
version: 2.0 | |
# | |
# All fields named `comment` simply provide a short explanatory paragraph for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Universal field getter method for JavaScript objects. | |
* @param {Object} _path The field path inside `this`. | |
* @param {...} _default The default value to be returns if field is not found. | |
* @return {...} Returns the found field value else `_default` else `undefined`. | |
*/ | |
Object.prototype._ = Object.prototype._ || function(_path, _default) { | |
var value = _path.split('.').reduce( | |
function(hash, field) { | |
return hash && hash[field] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demo: http://vpalos.com/sandbox/filter.js/ | |
* | |
* A generic search algorithm designed for filtering (very) large lists of strings; when an input string | |
* contains all the parts (words or characters; whitespace is ignored) of the query, spread-out over the text | |
* then the string is considered to be a match. It works with the way internet browsers (e.g. Firefox, Google | |
* Chrome) filter address-bar suggestions on user input. It is also quite fast; on my i7 laptop, filtering | |
* 1) a list of ~23000 items takes around 50ms (yes, milliseconds!); | |
* 2) a list of ~1 million text items took under 1 second. | |
* It works both in NodeJS as well as in browser environments (so far I only tested FF and GC). |
NewerOlder