View round.ts
// round(1234.5678, 2); // 1234.57
round(number, precision) {
var factor = Math.pow(10, precision);
var tempNumber = number * factor;
var roundedTempNumber = Math.round(tempNumber);
return roundedTempNumber / factor;
};
View paste-and-indent.js
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
// linux and windows
//{ "keys": ["ctrl+v"], "command": "paste_and_indent" },
//{ "keys": ["ctrl+shift+v"], "command": "paste" }
View app.const.ts
'use strict';
export const dist = '../path/to/dist/';
export const version: string = '0.0.1';
View tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "../dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
View keys.pipe.ts
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'keys'})
export class KeysPipe implements PipeTransform {
transform(value) : any {
let keys = [];
for (let key in value) {
keys.push({key: key, value: value[key]});
}
return keys;
View validIBAN.ts
//this.validIBAN('DE89 3704 0044 0532 0130 00');
validIBAN(iban) {
// valid == 1
// invalid != 1
console.log(this.isValidIBANNumber(iban));
}
isValidIBANNumber(input) {
let CODE_LENGTHS = {
View sort2level.js
sortArray(property, array) {
property = property.split('.');
var l = property.length;
return array.sort( function(a, b) {
var i = 0;
while( i < l) {
a = a[property[i]];
b = b[property[i]];
i++;
View criteriometer.markdown
View toggle.html
<p>
option 1
<label class="switch">
<input type="checkbox">
<div class="slider"></div>
</label>
option 2
</p>
View kv-redaktion-html-cheat-sheet.html
<!-- Überschriften -->
<h1>1. Überschrift</h1>
<h2>2. Überschrift</h2>
<h3>3. Überschrift</h3>
<h4>4. Überschrift</h4>
<h5>5. Überschrift</h5>
<h6>6. Überschrift</h6>