Skip to content

Instantly share code, notes, and snippets.

View glemiere's full-sized avatar
🐺
Happy Hunger Games

glemiere glemiere

🐺
Happy Hunger Games
  • The Matrix
View GitHub Profile
@glemiere
glemiere / ambidextrous-list.html
Created January 6, 2020 18:54
Ambidextrous re-orderable list under Angular and Ionic.
<ion-reorder-group (ionItemReorder)="reorderItems($event)" disabled="false" #list>
<ion-item *ngFor="let item of items">
<ion-reorder [slot]="handed === 'right' ? 'start' : 'end'"></ion-reorder>
<ion-label>
{{item}}
</ion-label>
<ion-badge color="primary" [slot]="handed === 'right' ? 'end' : 'start'">
{{items.indexOf(item)}}
</ion-badge>
</ion-item>
@glemiere
glemiere / ambidextrous-header.html
Created January 6, 2020 18:52
A simple hambidextrous header with Angular and Ionic.
<ion-buttons [slot]="handed === 'right' ? 'start' : 'end'">
<ion-button (click)="toggleReorder()">
Edit <ion-icon name="create"></ion-icon>
</ion-button>
</ion-buttons>
@glemiere
glemiere / package.json
Last active March 29, 2022 10:21
NPM Scripts to run Cypress with Angular ng serve command or SSR build.
/**********
package.json - remove this comment before using, as JSON files don't support comments.
---------------
Simple package.json file showing how to use Cypress with Angular.
npm run cy:prod used to test production build in CI/CD.
npm run cy:staging used to test staging build in CI/CD.
npm run cy:gui used to develop tests with livereload and angular dev/live server.
---------------
Requires wait-on and concurrently NPM packages as dev dependency to work correctly.
https://www.npmjs.com/package/wait-on and https://www.npmjs.com/package/concurrently
@glemiere
glemiere / Articles.jsx
Created June 29, 2018 06:21
Simple react component to produce a list of Articles from a medium user account.
/**********
Articles.jsx
---------------
Simple react component to produce a list of Articles from a medium user account.
---------------
Requires you to develop an Article component.
**********/
import style from './style.scss'
import helpers from '/helpers';
@glemiere
glemiere / Slide.jsx
Last active June 29, 2018 05:57
Simple react component to produce an isomorphic iDangerous Swiper slide with lazy-loading and SVG SQIP preview.
/**********
Slide.jsx
---------------
Simple react component to produce an isomorphic iDangerous Swiper slide with lazy-loading and SVG SQIP preview.
---------------
Requires iDangerous Swiper and sqip-loader :
https://idangero.us/
https://www.npmjs.com/package/sqip-loader
**********/
@glemiere
glemiere / TabsControl.ts
Last active June 29, 2018 04:21
Simple class written in TypeScript to provide control over a Ionic 2+ Tabs component. Currently provides animation between view changes using Tabs on iOS and Android.
/**********
TabsControl.ts
---------------
Simple class written in TypeScript to provide control over a Ionic 2+ Tabs component.
Currently provides animation between view changes using Tabs on iOS and Android.
---------------
Requires Ionic 2+ Tabs component and Cordova plugin NativePageTransition :
https://ionicframework.com/docs/api/components/tabs/Tabs/
https://ionicframework.com/docs/native/native-page-transitions/
---------------
@glemiere
glemiere / server.js
Created June 29, 2018 03:55
Simple file written in ES6 to serve a ExpressJS/NextJS Server.
/**********
server.ts
---------------
Simple file written in ES6 to serve a ExpressJS/NextJS Server.
Uses SSL, Compression, redirection and service worker routing. See server config file at :
https://github.com/glemiere/nextjs-starter/tree/master/config
---------------
Requires Let's Encrypt SSL Certificate :
https://letsencrypt.org/
**********/
@glemiere
glemiere / NotificationsService.js
Last active June 29, 2018 02:50
Simple ES5 module to send notifications through OneSignal from a NodeJS Server.
/**********
NotificationsService.js
---------------
Simple module written in ES5 to send notifications through OneSignal server-side.
NotificationsService.send : Sends a notification with the given "notif" parameter.
---------------
Requires OneSignal API key :
https://onesignal.com/
**********/
@glemiere
glemiere / calendar-component.html
Last active June 29, 2018 00:58
Implementation of a calendar component using Angular 2+ and two ionic components (ion-slides/ion-slide and ion-spinner).
<!--**********
calendar-component.html
Angular 2 UI Integration of a calendar component.
Displays monthly and weekly calendar, shows current day and outputs a selected day.
Refresh data on each month. Previous, current and next years should be calculated on app init for best performances.
Month to Month data calculation should be done in webworker thread for best performances.
Requires Angular 2+ and Ionic 2+ Slides/Slide and Spinner component:
@glemiere
glemiere / manifest.json
Last active June 28, 2018 17:49
Progressive Web App : manifest.json simple example.
/**********
manifest.json - remove this comment before using, as JSON files don't support comments.
---------------
Simple progressive web app configuration file.
Prompts user to download app outside the stores on mobile browser.
---------------
Requires SSL enabled and service workers. Test your project for PWA using lighthouse :
https://developers.google.com/web/tools/lighthouse/
**********/
{