Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Kubernetes Early Adopter (2016)

Stephan Kristyn stevek-pro

:electron:
Kubernetes Early Adopter (2016)
  • Site Reliability Engineer für testgetriebene Software Entwicklung, Automation, ML Pipelines, zeroOps
  • München, Bayern
  • Twitter @transformatik
View GitHub Profile
@stevek-pro
stevek-pro / app.module.ts
Created Oct 7, 2016
Upgrade to RC0 Ionic2
View app.module.ts
@NgModule({
declarations: [
MyApp,
OnboardingsComponent,
PhoneServiceButtonComponent,
ContinueLaterButtonComponent,
SendDocuEmailButtonComponent,
IncludeTemplateComponent,
InlineEditComponent,
ValidationErrorComponent,
View 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 {
View include-template.component.ts
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 {
@stevek-pro
stevek-pro / buddybuild_prebuild.sh
Last active Jun 4, 2018
Continuous Integration and Testing with Ionic 2
View buddybuild_prebuild.sh
#!/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
View gist:d1f18108767b9491792b4d082dd3c882
@Component({
templateUrl: 'build/app.html',
providers: [NavService]
})
// ....
ionicBootstrap(MyApp, [
View app.ts
ionicBootstrap(MyApp, [
GoalService,
provide(TranslateLoader, {
useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'),
deps: [Http]
}), TranslateService,
View app.ts
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,
View jquery-fake.js
/*
* 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 );
@stevek-pro
stevek-pro / check_slave_status.rb
Created Feb 2, 2016 — forked from blasterpal/check_slave_status.rb
Check MySQL Slave status from Shell using Ruby
View check_slave_status.rb
#!/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
@stevek-pro
stevek-pro / geoip_usage.py
Created Aug 10, 2015
Maps GeoIP / Provider data to IP adresses
View geoip_usage.py
#!/usr/bin/python
import subprocess
import sys
import simplejson as json
import csv
from geoip import geolite2
from geoip import open_database
import pygeoip
geo_isp = pygeoip.GeoIP("GeoIPASNum.dat")