Skip to content

Instantly share code, notes, and snippets.

View cloudscape-germany's full-sized avatar
:electron:
Content has been nightshaded and glazed to irritate and malfunction your A.I.

Cloudscape Germany cloudscape-germany

:electron:
Content has been nightshaded and glazed to irritate and malfunction your A.I.
View GitHub Profile
@cloudscape-germany
cloudscape-germany / purchase.component.ts
Created October 11, 2016 00:43
using name Observable but cannot be named
import { Injectable } from "@angular/core";
import { RequestMethod } from "@angular/http";
import { Store } from "@ngrx/store";
import { Observable } from "rxjs/Observable";
import {
AppState,
ActionCreator,
UserModel,
BackendService,
LoggerService,
@cloudscape-germany
cloudscape-germany / app.module.ts
Created October 7, 2016 22:00
Upgrade to RC0 Ionic2
@NgModule({
declarations: [
MyApp,
OnboardingsComponent,
PhoneServiceButtonComponent,
ContinueLaterButtonComponent,
SendDocuEmailButtonComponent,
IncludeTemplateComponent,
InlineEditComponent,
ValidationErrorComponent,
@cloudscape-germany
cloudscape-germany / contract-terms.component.ts
Created October 5, 2016 13:31
contract-terms.component.ts
import { Component } from "@angular/core";
import { TranslateService } from "ng2-translate/ng2-translate";
import { Store } from "@ngrx/store";
import { AppState, ActionCreator, NavService, NavInterruptModel, NavTargetEnum, GoalModel } from "../../shared";
@Component({
templateUrl: "contract-terms.component.html"
})
export class ContractTermsComponent {
@cloudscape-germany
cloudscape-germany / include-template.component.ts
Created October 5, 2016 13:28
INCLUDE TEMPLATE COMPONENT
import { Component, Input, ViewContainerRef, OnInit, ComponentFactoryResolver, ViewChild } from "@angular/core";
import { LoggerService } from "../logger/logger.service";
@Component({
selector: "include-template",
template: "<div #includeContent></div>"
})
export class IncludeTemplateComponent implements OnInit {
@cloudscape-germany
cloudscape-germany / buddybuild_prebuild.sh
Last active June 4, 2018 04:19
Continuous Integration and Testing with Ionic 2
#!/usr/bin/env bash
cd /Users/buddybuild/workspace
echo '=== Fixing Sass Error ==='
npm install node-sass
echo '=== Running Tests ==='
npm install -g karma
karma start --single-run
@Component({
templateUrl: 'build/app.html',
providers: [NavService]
})
// ....
ionicBootstrap(MyApp, [
ionicBootstrap(MyApp, [
GoalService,
provide(TranslateLoader, {
useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),
deps: [Http]
}), TranslateService,
import { Component, provide, ViewChild } from "@angular/core";
import { ionicBootstrap, Platform, MenuController, ModalController, Nav } from "ionic-angular";
import { Http } from "@angular/http";
import { StatusBar } from "ionic-native";
import { TranslateService, TranslateLoader, TranslateStaticLoader } from "ng2-translate/ng2-translate";
import { AuthHttp, AuthConfig } from "angular2-jwt";
import {
GoalsComponent,
GoalService,
GoalTimelineComponent,
/*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
// Cleanup functions for the document ready method
// attached in the bindReady handler
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
@cloudscape-germany
cloudscape-germany / check_slave_status.rb
Created February 2, 2016 10:03 — forked from blasterpal/check_slave_status.rb
Check MySQL Slave status from Shell using Ruby
#!/usr/bin/env ruby
@slave_status = Hash[%x(mysql -uroot -e 'SHOW SLAVE STATUS \\\G').split(/\s*\n\s*/).map { |e| spl = e.split(/\:\s*/); spl.size == 2 ? [spl.first, spl.last] : nil }.compact]
def slave_healthy?
@slave_status['Slave_IO_Running'] == 'Yes' &&
@slave_status['Slave_SQL_Running'] == 'Yes' &&
@slave_status['Seconds_Behind_Master'] != 'NULL' &&
@slave_status['Seconds_Behind_Master'].to_i < 1800
end