Skip to content

Instantly share code, notes, and snippets.

Avatar
🌚
Waiting for the next full moon

Önder Ceylan onderceylan

🌚
Waiting for the next full moon
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am onderceylan on github.
  • I am onderceylan (https://keybase.io/onderceylan) on keybase.
  • I have a public key ASCmsqA5Sdej2S3eJfHDu0B_XrJJ5t6u_mOpaNFD4e0_bwo

To claim this, I am signing this object:

View nyan.html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html {
background: radial-gradient(ellipse at center, #fff4fc 65%, #ffe8fd 100%);
width: 100%;
height: 100%;
}
@onderceylan
onderceylan / ngsw.json
Created Jan 28, 2019
Build a production ready PWA with Angular and Firebase - ngsw.json
View ngsw.json
{
"configVersion": 1,
"appData": {
"version": "1.1.0",
"changelog": "Added better resource caching"
},
"index": "/index.html",
"assetGroups": [
{
"name": "shell",
@onderceylan
onderceylan / firebase.json
Created Jan 26, 2019
Build a production ready PWA with Angular and Firebase - firebase.json
View firebase.json
{
"hosting": {
"public": "www",
"ignore": [
"firebase.json",
"3rdpartylicenses.txt",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
@onderceylan
onderceylan / ngsw-config.json
Last active Mar 3, 2019
Build a production ready PWA with Angular and Firebase - ngsw-config.json
View ngsw-config.json
{
"index": "/index.html",
"appData": {
"version": "1.1.0",
"changelog": "Added better resource caching"
},
"assetGroups": [
{
"name": "shell",
"installMode": "prefetch",
@onderceylan
onderceylan / manifest.json
Last active Jan 21, 2019
Build a production ready PWA with Angular and Firebase - manifest.json
View manifest.json
{
"name": "ITNEXT Summit 2018",
"short_name": "ITNEXT",
"description": "Be the best explorer in next-gen technologies. Experience use-cases, howtos and best-practices with latest frontend and backend technologies, network and security, engineering and low-code development with OutSystems.",
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone",
"orientation": "portrait",
"scope": "/",
"start_url": "/?utm_source=itnext_pwa_a2hs",
@onderceylan
onderceylan / events.selector.ts
Last active Sep 21, 2018
Composing selectors - selector
View events.selector.ts
import { createSelector } from '@ngrx/store';
import * as fromFeature from '../reducers';
import * as fromEvents from '../reducers/events.reducer';
import * as fromSettingsSelectors from '../../../settings/store/selectors';
import { eventEntityAdapter } from '../reducers/events.reducer';
import { filterEventEntitiesByUserSettings } from '../../utils/notification-utils';
import { filter, size } from 'lodash-es';
// This is a basic use case to slice feature state
export const getEventsState = createSelector(
@onderceylan
onderceylan / events.reducer.ts
Last active Apr 26, 2021
Entity adapter and some of the CUD operations - reducer
View events.reducer.ts
import * as fromEvents from '../actions/events.action';
import { createEntityAdapter, EntityAdapter, EntityState } from '@ngrx/entity';
import { Event } from '../../models/event.model';
export interface EventsState extends EntityState<EventEntity> {
loaded: boolean;
loading: boolean;
error: Error;
}
@onderceylan
onderceylan / settings.module.ts
Last active Jan 13, 2021
Persistent storage of your store - feature module
View settings.module.ts
import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import * as fromFeature from './store';
@NgModule({
imports: [
StoreModule.forFeature(fromFeature.FEATURE_NAME, fromFeature.reducers, {
metaReducers: fromFeature.metaReducers,
}),
@onderceylan
onderceylan / reducer.ts
Created Sep 19, 2018
Persistent storage of your store - reducer
View reducer.ts
import { Action, ActionReducer, ActionReducerMap, createFeatureSelector, MetaReducer } from '@ngrx/store';
import * as fromTimezone from './timezone.reducer';
import * as fromNotifications from './notification.reducer';
import { localStorageSync } from 'ngrx-store-localstorage';
export const FEATURE_NAME = 'settings';
const STORE_KEYS_TO_PERSIST = ['timezone', 'notifications'];
export interface SettingsState {
timezone: fromTimezone.TimezoneState;