Skip to content

Instantly share code, notes, and snippets.

@blueskyfish
blueskyfish / pom.xml
Last active August 29, 2015 13:55
pom.xml for create a über.jar
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
@blueskyfish
blueskyfish / Command.java
Last active August 29, 2015 14:05
NumberModel with Command Pattern
/*
* Copyright (c) 2014. BlueSkyFish <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
@blueskyfish
blueskyfish / Gruntfile.js
Created December 11, 2014 13:33
Basic Grunt / Npm / Bower files
module.exports = function (grunt) {
var _stage = grunt.option('stage') || 'dev',
_basePath,
_todayDate = grunt.template.today('yyyy-mm-dd'),
_todayTime = grunt.template.today('HH-MM-ss'),
_replacePattern = [];
switch (_stage.toLowerCase()) {
case 'prod':
@blueskyfish
blueskyfish / MyFixedHandler
Created March 15, 2015 12:59
Add the java logging to the Android platform
package kirchnerei.httpclient;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
public class MyHandlerHandler extends Handler implements DalvikLogHandler {
@blueskyfish
blueskyfish / user-route.js
Created April 8, 2017 04:47
Database with transaction
'use strict';
const express = require('express');
const executor = require('app/executor');
const userService = require('app/service/user-service');
//
// Router: /users
@blueskyfish
blueskyfish / messaging.service.ts
Last active May 31, 2018 14:59
Messaging in Angular 4+
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
/**
* **Note**: The internal structure of the message queue.
*/
export interface IMessage {

ReduxTrigger

A small angular service for trigger action when certain conditions occur.

Using the Angular module @angular-redux/store.

Example

Trigger a list of Redux Action

@blueskyfish
blueskyfish / _mixins.scss
Created February 19, 2020 17:12
Mixins for Angular App
@mixin display-flex($direction, $wrap: nowrap) {
display: flex;
flex-direction: $direction;
flex-wrap: $wrap;
}
@mixin flex-resizable($basis: auto, $grow: 1, $shrink: 1) {
flex-basis: $basis;
flex-grow: $grow;
@blueskyfish
blueskyfish / subscriber-list.ts
Created February 19, 2020 17:16
Collection of Subscription
import { SubscriptionLike } from 'rxjs';
export class SubscriberList implements SubscriptionLike {
private mList: SubscriptionLike[] = [];
private mClosed = false;
get closed(): boolean {
return this.mClosed;
@blueskyfish
blueskyfish / Dockerfile
Last active September 15, 2020 15:32
A docker file in order to build node application with multi stage
#
# Multipart dockerfile for build the application and the delivery docker image
#
FROM node:12-alpine AS builder
WORKDIR /builder
RUN \
apk add --update tree openssl && \
mkdir -p /builder/frontend/src /builder/app /builder/backend/src