Skip to content

Instantly share code, notes, and snippets.

View demsey2's full-sized avatar

Dawid Tomkalski demsey2

  • Gold Coast
View GitHub Profile
import { ErrorHandler } from '@angular/core';
@Injectable()
export class GlobalErrorHandler implements ErrorHandler {
handleError(error: any): void {
const chunkFailedMessage = /Loading chunk [\d]+ failed/;
if (chunkFailedMessage.test(err.message)) {
window.location.reload();
@demsey2
demsey2 / gist:c957cb6bcce39efad564ca40a266d84f
Created April 6, 2018 23:20
CloudFront Lambda security headers
// https://blog.crashtest-security.com/lambda-edge-to-configure-http-security-headers-for-cloudfront-34a44775061d
'use strict';
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
const headers = response.headers;
// Add security headers
@demsey2
demsey2 / ios-release
Last active March 23, 2017 20:14
ios release
based on https://www.raywenderlich.com/127936/submit-an-app-part-1
1. First you’ll need to generate two certificates, one for your development profiles and another for your distribution profiles
- this can be done from xcode
2. Registering Devices
3. Creating App IDs
4. Provisioning Profiles
@demsey2
demsey2 / gist:d31c96479afc4fc899a8
Created February 3, 2016 02:22
ClickAllCheckboxes
Array.prototype.forEach.call(document.querySelectorAll('input[type=checkbox]'), function(l){l.onclick = null; l.click()})
@demsey2
demsey2 / gist:0f80cab40492e80577b3
Created February 3, 2016 02:21
ClickAllRadios
Array.prototype.forEach.call(document.querySelectorAll('input[type=radio]'), function(l){l.click()})
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
[].map.call(document.querySelectorAll('.confirmit-abtn-table-grid td'), function(e) {e.click();})
$('#gender').prop('checked', true);
$('#daydropdown').val(24).change();
$('#monthdropdown').val('Nov').change();
$('#yeardropdown').val(1981).change();
$('#txtZipcode').val(4210).change();