Skip to content

Instantly share code, notes, and snippets.

@kitko112
kitko112 / despisers_of_the_body.ts
Last active March 15, 2021 17:00
to understand the concept of body from Nietzsche point of view
// concept of Body, its characteractics are sense, spirit and ego
class Body {
private sense = new Sense();
private spirit = new Spirit();
private ego = new Ego();
// assume a person is weak in willing
private hasStrongWill = false;
public experience(input): Will {
var Actor = function () {
this._lastName = 'Tom';
this._firstName = 'Hanks';
}
Actor.prototype.getFullName = function () {
return this._lastName + ' ' + this._firstName
}
var actor = new Actor();
var greeting = function (getFullNameFunc) {
var Actor = function () {
this._lastName = 'Tom';
this._firstName = 'Hanks';
}
Actor.prototype.getFullName = function () {
return this._lastName + ' ' + this._firstName
}
var actor = new Actor();
var greeting = function (getFullNameFunc) {
var Actor = function () {
this._lastName = 'Tom';
this._firstName = 'Hanks';
}
Actor.prototype.getFullName = function () {
return this._lastName + ' ' + this._firstName
}
var actor = new Actor();
var greeting = function (getFullNameFunc) {
import * as fs from 'fs';
async function longRunJsFunction(count) {
let y = 0;
for (let i = 0; i < count; i++) {
}
console.log('longRunJsFunction finished');
return 1;
}
import { Person } from "./personAbstractClass";
class Student extends Person {
constructor(
firstName: string,
lastName: string,
private _studentId: number
) {
super(firstName, lastName);
}
export class abstract Person {
constructor(
protected _firstName: string,
protected _lastName: string
) {
}
}
@kitko112
kitko112 / ClassA.ts
Last active October 6, 2017 16:08
ClassA containing one public method and one protected method
export class ClassA {
constructor(private _fullName: string) {
}
public Greeting(): void {
const fullName = this.getFullName();
console.log(`Hello ${fullName}!`);
}
@kitko112
kitko112 / ClassASuite.spec.ts
Last active October 5, 2017 17:05
extends the target testing class with `@suite`
import { ClassA } from "../classA";
import { suite, test, slow, timeout } from "mocha-typescript";
import { assert } from "chai";
@suite("ClassA test suite")
class ClassASuite extends ClassA {
constructor() {
super("Tom Hanks");
}