Skip to content

Instantly share code, notes, and snippets.

@ndavis
ndavis / oktaLogin.js
Created November 7, 2019 03:38
Cypress Custom Command for Okta Login
Cypress.Commands.add('loginOkta', () => {
const optionsSessionToken = {
method: 'POST',
url: Cypress.env('session_token_url'),
body: {
username: Cypress.env('username'),
password: Cypress.env('password'),
options: {
warnBeforePasswordExpired: 'true'
}
@nrobinaubertin
nrobinaubertin / app.component.ts
Created January 17, 2017 13:36
Exemple of ngb-date-parser-formatter implementation (ng-bootstrap)
import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbDateFRParserFormatter } from "./ngb-date-fr-parser-formatter"
@Component({
providers: [{provide: NgbDateParserFormatter, useClass: NgbDateFRParserFormatter}]
})
export class AppComponent {}
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
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

@mauriciosoares
mauriciosoares / doubleclick.js
Created October 19, 2015 20:07
rxjs double click example
let clickStream = Rx.Observable.fromEvent(document.getElementById('link'), 'click');
clickStream
.buffer(clickStream.debounce(250))
.map(list => list.length)
.filter(x => x === 2)
.subscribe(() => {
console.log('doubleclick');
})
@rikukissa
rikukissa / POST.md
Last active January 27, 2020 08:10
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom #angular.js #testing
title slug createdAt language preview
Unit testing Angular.js app with node.js, mocha, angular-mocks and jsdom
unit-testing-angular-js-app-with-node
2015-07-05T18:04:33Z
en
Majority of search result about unit testing Angular.js apps is about how to do it by using test frameworks that run the tests in a real browser. Even though it's great to be able to test your code in multiple platforms, in my opinion it creates a lot of boilerplate code and makes it hard to run the tests in, for instance a CI-server.

Testing Angular.js app headlessly with node.js + mocha

Lean unit tests with minimal setup

@alexhawkins
alexhawkins / goodControllerStyle.js
Last active January 6, 2016 05:03
Sample Controller and Service using ES6 and John Papa Style Guide
(() => {
'use strict';
/*************************************************************
* @ngdoc controller
* @name dashboard.customer.controller:CustomerCtrl
*
* @description
*
* CustomerCtrl Class for Customer Model
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@boazsender
boazsender / mobilecheckbox.css
Created August 30, 2012 04:34
Mobile CSS checkboxes
input[type=checkbox] {
outline: none;
width: 58px;
height: 23px;
font-size: 11px;
line-height: 2;
display: block;
font-weight: bold;
border-radius: 3px;
border: 1px solid #B9B9B9;
@mattpodwysocki
mattpodwysocki / dragdrop.html
Created March 22, 2012 04:54
Drag and Drop in RxJS
<!DOCTYPE html>
<head>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="rx.min.js" type="text/javascript"></script>
<script src="rx.jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var dragTarget = $('#dragTarget')