Skip to content

Instantly share code, notes, and snippets.

View anteburazer's full-sized avatar
💭
Ride hard live free

Ante Burazer anteburazer

💭
Ride hard live free
View GitHub Profile
(function() {
'use strict';
/* ***************************************************************************
* ### WorkerBridge module ###
*
* Module for constructing web workers
* Reference: https://github.com/blittle/bridged-worker
* ***************************************************************************
*/
(function() {
'use strict';
var workersModule = angular.module('App.Workers');
workersModule.service('InsertDataWorker', [
'$rootScope',
'$cordovaSQLite',
'WorkerBridge',
'LocalDB',
@anteburazer
anteburazer / fast-scroll.scss
Last active October 28, 2019 02:17
Ionic fast scroll
fast-scroll {
position: fixed;
top: 102px;
right: 5px;
padding: 10px 5px;
background: #f8f8f8;
border-radius: 10px;
border: 1px solid #ddd;
span {
function(signInDate, signOutDate, PauseOptions, PauseOptionId, isSignInTimeSelected, isSignOutTimeSelected) {
// Calculate number of hours employee has worked for
var signInDate = new Date(signInDate),
signOutDate = new Date(signOutDate),
signInOffset = isSignInTimeSelected ? 0 : signInDate.getTimezoneOffset() * 60 * 1000,
signOutOffset = isSignOutTimeSelected ? 0 : signOutDate.getTimezoneOffset() * 60 * 1000,
diff = signOutDate - signInDate + signOutOffset - signInOffset,
pause = 0,
workingMinutes,
workingHours,
var fs = require('fs');
var mapFilePath = './classes-map.json';
var filesToReplace = [
{ path: './main.css', rename: './main-rename.css', type: 'css'},
{ path: './index.html', rename: './index-rename.html', type: 'html'},
{ path: './scripts.js', rename: './scripts-rename.js', type: 'js'}
];
@Component({
selector: 'product',
template: `Product details`
})
export class ProductComponent{
constructor(
private store: Store<AppStore>,
private httpService: HttpService
){}
}
@NgModule({
declarations: [
AppComponent,
],
imports: [
// Angular core dependencies
BrowserModule,
HttpModule,
// Http service
export abstract class Sandbox {
protected loggedUser$ = this.appState$.select(store.getLoggedUser);
constructor(protected appState$: Store<store.State>) {}
/**
* Returns complete or partial state from the store
*
* @param store
* @param property
@Injectable()
export class AuthSandbox extends Sandbox {
public loginLoading$ = this.appState$.select(store.getLoginLoading);
public loginLoaded$ = this.appState$.select(store.getLoginLoaded);
public passwordRecoveryLoading$ = this.appState$.select(store.getPasswordRecoveryLoading);
public passwordRecoveryLoaded$ = this.appState$.select(store.getPasswordRecoveryLoaded);
constructor(protected appState$: Store<store.State>) {
super(appState$);
export interface State {
products: fromProducts.State;
login: fromAuth.State;
}
const reducers = {
products: fromProducts.reducer,
login: fromAuth.reducer
};