Skip to content

Instantly share code, notes, and snippets.

View schmkr's full-sized avatar

Alwin Schoemaker schmkr

View GitHub Profile
@schmkr
schmkr / README.md
Last active July 24, 2020 10:26
Zoneless Angular App

Example of running an Angular app without NgZone

Angular app that is running without NgZone. Triggering change-detection happens like this:

merge(
	fromEvent(document, 'click'),
	fromEvent(document, 'mousemove'),
	fromEvent(document, 'keydown'),
	fromEvent(document, 'scroll'),
#tab1:checked ~ div .na-keuze #eindcijfer1,
#tab2:checked ~ div .na-keuze #eindcijfer1,
#tab2:checked ~ div .na-keuze #eindcijfer2,
#tab3:checked ~ div .na-keuze #eindcijfer1,
#tab3:checked ~ div .na-keuze #eindcijfer2,
#tab3:checked ~ div .na-keuze #eindcijfer3,
#tab4:checked ~ div .na-keuze #eindcijfer1,
#tab4:checked ~ div .na-keuze #eindcijfer2,
#tab4:checked ~ div .na-keuze #eindcijfer3,
#tab4:checked ~ div .na-keuze #eindcijfer4,
@schmkr
schmkr / README.md
Created August 3, 2018 12:03
CodeceptJS helper to check for emails in Mailcatcher

CodeceptJS helper for Mailcatcher

This is a helper for CodeceptJS to check for emails sent to MailCatcher during a test.

usage

  • Download mailcatcher.js to your project that has CodeceptJS and make sure to add got as npm dependency (or replace the usages of got in this helper by your preferred http library).
  • Make sure the application you're testing is sending the emails to a mailcatcher instance.

In your codecept.config.js add something like this to your helpers configuration:

@schmkr
schmkr / example.js
Last active June 23, 2020 13:03
angular ui router 404 without redirect
angular.module("app.example", ["ui.router"])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider.state("404", {
templateUrl: "errors/notfound.tpl.html",
data: {
authorizationRequired: false,
permissionsRequired: [],
bodyClass: "error"
}
@schmkr
schmkr / PasswordRandomValue.js
Created November 5, 2015 12:08
Paw extension for generating random passwords.
(function() {
var PasswordRandomizerDynamicValue,
charset = [
"abcdefghijklmnopqrstuvwxyz",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"0123456789",
"!@#$%ˆ&*()-=_+{}[]|<>,.?/"
].join('');
PasswordRandomizerDynamicValue = function() {
@schmkr
schmkr / keybase.md
Last active February 5, 2016 10:28

Keybase proof

I hereby claim:

  • I am schmkr on github.
  • I am schmkr (https://keybase.io/schmkr) on keybase.
  • I have a public key ASAqVESetfmN3uI8p94Qy_0yg1RPbDwQcDQhbiZdP9zUzgo

To claim this, I am signing this object:

@schmkr
schmkr / crontab.txt
Created August 25, 2014 15:05
An example of how to get the output of a cronjob to go to both STDOUT (so it can be emailed to MAILTO) and logged to a file.
0 0 * * * sh script.sh 2>&1 | tee -a /var/log/script.`date +\%Y\%m\%d`.log
@schmkr
schmkr / gist:505f69bb4e4cd96a56c4
Created August 14, 2014 15:06
Onename.io verification
Verifying that +schmkr is my Bitcoin username. You can send me #bitcoin here: https://onename.io/schmkr
# NPM CheatSheet.
# Super easy intall: npm comes with node now.
# To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html
# More: https://www.npmjs.org/doc/
# 1. NPM Command Lines.
# Local mode is the default.
# Use --global or -g on any command to operate in global mode instead.
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="http://code.highcharts.com/highcharts.js"></script>