Skip to content

Instantly share code, notes, and snippets.

View peterbsmyth's full-sized avatar

Peter B Smith peterbsmyth

View GitHub Profile
@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}))
);
@MichalZalecki
MichalZalecki / index.js
Created March 12, 2016 12:24
How to import RxJS 5
// Import all
import Rx from "rxjs/Rx";
Rx.Observable
.interval(200)
.take(9)
.map(x => x + "!!!")
.bufferCount(2)
.subscribe(::console.log);
@icaroscherma
icaroscherma / controller.js
Last active March 31, 2017 11:33
Ionic Sample: Confirm Popup with checkbox
// Using show()
$scope.garageToggle = function() {
$scope.data = { hasWorkEntry: true };
$ionicPopup.show({
title: 'Are you sure you want to open the garage?',
content: '<ion-checkbox ng-model="data.hasWorkEntry" ng-checked="data.hasWorkEntry">Mark as Work Entry?</ion-checkbox>',
scope: $scope,
buttons: [
{text: 'Cancel'},
@fabien-d
fabien-d / Object.assign.js
Created September 22, 2015 16:27
Nested Object.assign calls formatting
let object = {
key: {
subkey: 'value',
status: 'STATUS'
}
};
// compact
Object.assign( {}, object, { key: Object.assign( {}, object.key, { status: 'PENDING' } ) } );
@icfantv
icfantv / example.html
Created May 6, 2015 16:47
ControllerAs Syntax
<html>
<head>
<!-- include angular -->
</head>
<body data-ng-app='app'>
<div data-ng-controller='MyController as MyController'>
<!-- bound once -->
Controller Loaded: {{ ::MyController.someModel.controllerLoaded }}
<hr/>
<!-- two-way binding -->
@rolaveric
rolaveric / mixinSchema.json
Created March 28, 2015 02:29
Example of using "allOf" to make JSON Schema mixins
{
"definitions": {
"nameMixin": {
"type": "object",
"properties": {
"nameFirst": {"type": "string"},
"nameLast": {"type": "string"}
},
"required": ["nameFirst", "nameLast"]
},
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 9, 2024 13:54
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\