Skip to content

Instantly share code, notes, and snippets.

View joeherold's full-sized avatar

Johannes Pichler joeherold

View GitHub Profile
@joeherold
joeherold / NodoSocket.service.ts
Last active April 3, 2018 03:52
a sample implementation of socket.io in angular2 and typescript
/**!
* nodocms backend application
* Copyright(c) 2015 Johannes Pichler - webpixels
* Created by johannespichler on 23.11.15.
* LGPLv3.0 Licensed
**/
@joeherold
joeherold / app.ts
Last active November 23, 2015 12:52
import { Http, HTTP_PROVIDERS } from 'angular2/http';
import { ROUTER_DIRECTIVES, RouteConfig, RouterOutlet, RouterLink, AsyncRoute, Router, RouteRegistry } from 'angular2/router';
import { ROUTER_PRIMARY_COMPONENT, APP_BASE_HREF, ROUTER_PROVIDERS as NG2_ROUTER_PROVIDERS, LocationStrategy, HashLocationStrategy,PathLocationStrategy } from 'angular2/router';
// import your components, you want to use for routes
import {MyPluginComponent, MyAnotherPluginComponent} from './myComponents/components';
@Component({
//your definitions here
})
@joeherold
joeherold / dasboard.component.ts
Created June 22, 2016 22:38
Observable not updated in Component View
import {Component, OnInit, ChangeDetectorRef, ChangeDetectionStrategy} from "@angular/core";
import {FDB_DIRECTIVES} from "../components";
import {CalendarPipe, DateFormatPipe, TimeAgoPipe, FromUnixPipe} from "angular2-moment/index";
import {OrderByPipe} from "../pipes/order-by.pipe";
import {ResourceService} from "../services/resource.service";
//import {MiniCalendarComponent, CardComponent, CardContentHeaderComponent, AvatarComponent} from "../shared";
declare let jQuery:any;
//directives: [MiniCalendarComponent, CardComponent, AvatarComponent, CardComponent, CardContentHeaderComponent]
@joeherold
joeherold / README.md
Created June 23, 2017 13:26
React Style-Guide for webpixels and pliigo projects
@joeherold
joeherold / index.d.ts
Created April 20, 2020 12:33
Sails Typings to work with Model, Controllers, ModelDefinition and so on...
// declare var ;
declare namespace Sails {
enum SortOption {
ASC,
DESC,
}
type SortOptions = keyof typeof SortOption;
interface Criteria {
or?: Criteria[];
@joeherold
joeherold / NativeQueryService.ts
Last active April 20, 2020 20:14
A sample Service for Sails.js to transform a (in this case sails-postgres) raw result from sendNativeQuery to an regular model result
/*
* Created Date: Monday, April 20th 2020, 3:03:54 pm
* Author: Johannes Pichler
*
* Copyright (c) 2020 Webpixels e.U.
*/
let processAllRecords = require("waterline/lib/waterline/utils/query/process-all-records");
export type RawResult = {