Skip to content

Instantly share code, notes, and snippets.

View BrianJVarley's full-sized avatar

Brian Varley BrianJVarley

View GitHub Profile
@matheo
matheo / app.initializer.ts
Created February 15, 2019 05:11
Angular APP_INITIALIZER with NgRx Effects
/**
* App Initializer with Effects
*/
export function initApplication(store: Store<AppState>) {
return () =>
new Promise(resolve => {
const loaded$ = new Subject();
store.dispatch(new LoadSystem());
store
@axdotl
axdotl / keycloak-export-import-k8s.md
Last active October 30, 2023 08:43
Keycloak Export in Kubernetes

Perform Keycloak Export and Import on Kubernetes

  • Setup Keycloak in non-HA mode (replica 1)
  • Disable UserFederation
  • You might have to increase the resource limits to avoid that pod beeing killed by memory or CPU limits

See Keycloak Documentation for more details.

Export

@obliviusm
obliviusm / Fastfile
Created October 2, 2017 20:26
android/fastlane/Fastfile
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
# need to use `react-native bundle` instead of bundleReleaseJsAndAssets from grdale
# because it causes 134 error (out of memory) on Circle CI
sh "cd ../.. && react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/"
gradle(
task: "assembleRelease",
flags: "-x bundleReleaseJsAndAssets"
)
crashlytics(
@bertrandg
bertrandg / ngrx-effects-advance-example.js
Last active October 3, 2022 02:22
ngrx/effects advance example
// Nothing changed here, works as previously.
@Effect() actionX$ = this.updates$
.ofType('ACTION_X')
.map(toPayload)
.switchMap(payload => this.api.callApiX(payload)
.map(data => ({type: 'ACTION_X_SUCCESS', payload: data}))
.catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err}))
);
@btroncone
btroncone / ngrxintro.md
Last active June 26, 2024 08:27
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@wmertens
wmertens / full stack redux.md
Last active February 8, 2022 22:46
making an awesome server with the redux model, Work In Progress

Thought experiment: Redux-like stateless server

Description

We describe a model for client-server processing where the Redux model is used to minimize stateful code. This should allow live-reloading server code, and make it possible to share code (e.g. optimistic updating) between client and server.

Dramatis Personae

  • Assume a server consisting of multiple worker processes that do not share memory and may be running on multiple hosts.
    • Workers have middleware, root reducers and an app state object
  • Workers can be dynamically added and removed
@seanislegend
seanislegend / rxjs-example-poll-url.js
Last active August 12, 2019 09:43
RxJS - Poll a URL
let timeout = 1000;
/**
* Create a custom observable that creates a XHR request and returns complete when the promise is fulfilled
*/
let observable = Rx.Observable.create((o) => {
dataService.fetch('test.json')
.then((data) => {
o.onNext(data);
o.onCompleted();
anonymous
anonymous / gist:557284161332bf9d1d1d
Created May 23, 2015 18:57
Simple IoC container
internal class ResourceManager
{
#region Singleton
private static Lazy<ResourceManager> instance = new Lazy<ResourceManager>(() => new ResourceManager());
internal static ResourceManager Instance { get { return instance.Value; } }
private ResourceManager()
{
@GeoffCox
GeoffCox / Global.asax.cs
Created April 16, 2015 00:07
Allow multiple origins for CORS using ASP.NET MVC
protected void Application_BeginRequest()
{
this.SetupCorsHeaders();
//OPTIONS request comes before the POST to know the permissions. this forces to send the reply.
if (((IList)Request.Headers.AllKeys).Contains("Origin") && Request.HttpMethod == "OPTIONS")
{
Response.Flush();
}
}
@patrickhammond
patrickhammond / gist:0b13ec35160af758d98c
Created March 8, 2015 02:30
Sample for how to use the Google Play Services dynamic security provider to keep the SSL library that the app will use to up date.
package com.mycompany.myapp.app;
import android.app.Application;
import android.content.Intent;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.security.ProviderInstaller;
import com.google.android.gms.security.ProviderInstaller.ProviderInstallListener;
public class MainApplication extends Application {