Skip to content

Instantly share code, notes, and snippets.

View mlabieniec's full-sized avatar

Michael Labieniec mlabieniec

View GitHub Profile
@mlabieniec
mlabieniec / .eslintrc
Created May 24, 2017 13:58 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@mlabieniec
mlabieniec / .eslintrc
Created May 24, 2017 13:58 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@mlabieniec
mlabieniec / connecting-to-aws-codecommit.md
Last active December 23, 2017 17:54
Connecting to AWS CodeCommit
  1. Goto your AWS IAM Console and create or modify a current IAM user (preferably the one you use to connect with your AWS CLI)

  2. Goto Security Credentials -> Scroll down to SSH keys for AWS CodeCommit

  3. Create a private/public ssh key on your local machine:

    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

  4. Click on "Upload SSH Public Key" and paste in the contents of ~/.ssh/id_rsa.pub into the textarea and save.

  5. Note the Access Key ID that was generated, it will be something like APKA********** this will be used as your User for SSH access

  6. Navigate to the AWS CodeCommit Console and click on your repository (or create one)

  7. Create a ~/.ssh/config file with the following contents (modify for your setup/names):

@mlabieniec
mlabieniec / auth.scss
Last active June 5, 2018 17:51
AWS Amplify Ionic PWA
page-auth {
.amplify-authenticator {
@extend .card;
padding-bottom: 1em;
}
.amplify-form-input {
@extend .text-input;
@extend .text-input-md;
@mlabieniec
mlabieniec / Delete all Public S3 Buckets
Last active December 5, 2018 20:07
This bash command will delete ALL S3 buckets that do not have versions. This will delete anything public (but also private based on your creds) but will error out on any deployment buckets (used for lambda etc.) Use at your own risk!
#!/bin/bash
aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'aws s3 rb s3://{} --force'
<div class="container">
<mat-sidenav-container
fullscreen
[hasBackdrop]="mobileQuery.matches">
<mat-sidenav #lnav
mode="over"
class="sidenav">
<div class="content">
<mat-list>
<mat-list-item *ngFor="let route of nav">
{
"hosting": {
"S3AndCloudFront": {
"service": "S3AndCloudFront",
"providerPlugin": "awscloudformation",
"providerMetadata": {
"s3TemplateURL": "https://s3.amazonaws.com/xxx/hosting/template.json",
"logicalId": "hostingS3AndCloudFront"
},
"lastPushTimeStamp": "2018-10-27T18:39:35.710Z",
@mlabieniec
mlabieniec / index.html
Created October 28, 2018 16:10
Custom iOS PWA Splash Screen
<link rel="apple-touch-startup-image" href="assets/splash/launch-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="assets/splash/launch-750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="assets/splash/launch-1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="assets/splash/launch-1125x2436.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="assets/splash/launch-1536x2048.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
<lin
@mlabieniec
mlabieniec / app.component.ts
Created October 28, 2018 16:28
PWA iOS Detection and Installation Banner
ngOnInit() {
// Detects if device is on iOS
const isIos = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
return /iphone|ipad|ipod/.test( userAgent );
}
// Detects if device is in standalone mode
const isInStandaloneMode = () => ('standalone' in (window as any).navigator) && ((window as any).navigator.standalone);
// Checks if should display install popup notification:
@mlabieniec
mlabieniec / ios-install.component.html
Last active October 28, 2018 18:05
iOS PWA Install Notification HTML
<div class="content">
Install this app on your device.
<br/>Tap the share icon and then <br/><strong>Add to homescreen</strong>.
<div class="full-width"><mat-icon>arrow_downward</mat-icon></div>
</div>
<button class="btn-close" mat-icon-button (click)="close()" aria-label="Close">
<mat-icon>close</mat-icon>
</button>