Skip to content

Instantly share code, notes, and snippets.

🚁
Hawaii is Awesome

Gerard Sans gsans

🚁
Hawaii is Awesome
Block or report user

Report or block gsans

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gsans
gsans / gist:5929028e2b41a89e24ad8641638ba983
Last active Aug 31, 2019
Delete a batch of items using GraphQL
View gist:5929028e2b41a89e24ad8641638ba983
# GraphQL query
mutation batchDelete($a:ID $b:ID $c:ID $d:ID $e:ID) {
a:deleteItem(input:{ id:$a }) { id }
b:deleteItem(input:{ id:$b }) { id }
c:deleteItem(input:{ id:$c }) { id }
d:deleteItem(input:{ id:$d }) { id }
e:deleteItem(input:{ id:$e }) { id }
}
# Query variables
@gsans
gsans / API.ts
Last active Aug 22, 2019
API.ts
View API.ts
/* tslint:disable */
// This file was automatically generated and should not be edited.
import { Injectable } from "@angular/core";
import API, { graphqlOperation } from "@aws-amplify/api";
import { GraphQLResult } from "@aws-amplify/api/lib/types";
import * as Observable from "zen-observable";
export type CreateRestaurantInput = {
id?: string | null;
clientId?: string | null;
View cat.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-cat',
template: `
<div>
<a href="http://aws.amazon.com/amplify" target="_blank" alt="AWS Amplify" title="Miau"><img class="cat btn" src="data:image/png;base64,iVBORw..."/></a>
</div>
`,
styles: [`
View angular-logo.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-angular-logo',
template: `
<div class="logo">
<a href="http://angular.io" target="_blank" alt="Angular">
<svg>
<style type="text/css">.st0 { fill: #DD0031; } .st1 { fill: #C3002F; } .st2 { fill: #FFFFFF; }</style>
<g>
View counter.actions.ts
import { Action } from '@ngrx/store';
export enum CounterActionTypes {
Increment = '[Counter] Increment',
Decrement = '[Counter] Decrement',
Reset = '[Counter] Reset'
}
export class CounterIncrement implements Action {
readonly type = CounterActionTypes.Increment;
View gist:4d01addc9d00648fe92c3ee54462ea72
./node_modules/protractor/bin/webdriver-manager update
View launch.protractor.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Protractor - Suite: reference",
@gsans
gsans / introspection.json
Created Apr 21, 2018
Introspection result
View introspection.json
{
"data": {
"__schema": {
"directives": [
{
"name": "include",
"description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
"locations": [
"FIELD",
"FRAGMENT_SPREAD",
@gsans
gsans / router-transitions-util.md
Last active Apr 21, 2018
Refactoring router transitions
View router-transitions-util.md

yummy

Refactoring multiple router transitions - Angular (v5+)

We can apply this refactor when we identify a group of transitions running the same animation following the same pattern.

Code:

// BEFORE
You can’t perform that action at this time.