Skip to content

Instantly share code, notes, and snippets.

View maleeb's full-sized avatar
:octocat:
done. going to bed now.

Ali maleeb

:octocat:
done. going to bed now.
View GitHub Profile
@maleeb
maleeb / ultimate-ut-cheat-sheet.md
Created July 17, 2018 14:07 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@maleeb
maleeb / canvas.js
Created July 31, 2016 21:22
AngualrJS canvas directive
.directive("drawing", function() {
return {
restrict: "A",
link: function(scope, element) {
var ctx = element[0].getContext('2d');
// variable that decides if something should be drawn on mousemove
var drawing = false;
@maleeb
maleeb / fileservice.js
Last active October 16, 2016 01:03
AngularJS file service for ionic (org.apache.cordova.file)
//Filesystem (checkDir, createDir, checkFile, creatFile, removeFile, writeFile, readeFile)
.factory('FileService', function($q) {
return {
checkDir: function (dir) {
var deferred = $q.defer();
getFilesystem().then(
function(filesystem) {
filesystem.root.getDirectory(dir, {create: false},