Skip to content

Instantly share code, notes, and snippets.

View zulucoda's full-sized avatar

Muzikayise Flynn Buthelezi (zuluCoda) zulucoda

View GitHub Profile
@zulucoda
zulucoda / userLoginSagaRefactor.test.js
Created January 26, 2019 14:35
Unit Test - Login Sagas
describe('Unit Test - Login Sagas', () => {
describe('userLoginSagaRefactor', () => {
describe('when user is authorised', () => {
it('should yield userLoginSagaRefactor saga, which yields getLoginFormState, yield authoriseUser yield LoginActions.clearLogin and yield getUserSettingsSaga', () => {
const generator = userLoginSagaRefactor();
expect(generator.next().value).toEqual(select(getLoginFormState));
expect(
generator.next({
@zulucoda
zulucoda / userLoginSagaRefactor.js
Last active January 27, 2019 08:52
After Refactor - user login proccess
/**
* Authorise user
* @param username
* @param password
*/
export function* authoriseUserSaga(username, password) {
try {
// call login Api endpoint with user username and password
const loginService = new LoginService();
const response = yield call([loginService, get, username, password]);
@zulucoda
zulucoda / userLoginSaga.js
Last active January 27, 2019 08:53
Before Refactor - user login proccess
/**
* Before Refactor - user login proccess
* @see https://blog.mfbproject.co.za
*/
export function* userLoginSaga() {
// 1. get the username and password from state.
const { username, password } = yield select(getLoginFormState);
// 2. call login API endpoint with the username and password
@zulucoda
zulucoda / create-web-application-in-iis.ps1
Created October 5, 2014 15:07
This is a PowerShell script which can be used to deploy web applications to IIS. Therefore you may use to automate your deployments.
<# .SYNOPSIS
create-web-application - Automatic website creation.
.DESCRIPTION
Allows you to create a website and its ApplicationPool.
.NOTES
File Name : create-web-application.ps1
Author : Muzikayise Flynn Buthelezi - muzi@mfbproject.co.za
Copyright : MFBproject mfbproject.co.za
.EXAMPLE
PS D:\>create-web-application.ps1 -SiteName TESTSITE -Port 8080 -Environment PREPROD -Runtime v4.0 -Pipeline Classic
@zulucoda
zulucoda / webstorm-input-fix.sh
Last active August 29, 2015 14:05
A small minor issue in Ubuntu. is a random bug which causes the IDEs to loose cursor, therefore it seems like your IDEs is frozen but it's not you still able to perform mouse clicks and select menus but you just can't type. There's a bug open for this issue but because it's difficult to resolve because it occurs randomly. This may seem frustrati…
#!/bin/bash
clear
echo "webstorm or rubymine keyboard input reset"
ibus restart
echo "done"