Skip to content

Instantly share code, notes, and snippets.

View tb's full-sized avatar
🚀
Building High-Performing Software Engineering Teams

Tomasz Bak tb

🚀
Building High-Performing Software Engineering Teams
View GitHub Profile
@tb
tb / errorize.js
Last active November 28, 2015 17:44 — forked from ryrych/errorize.js
After refactoring #2 - modified
import Ember from 'ember';
var errorize = Ember.Object.extend({
init() {
this._super();
this.set('errorsList', {});
},
// test should check various inputs and verify addToErrorsList is called with proper arguments
processError(error) {
@tb
tb / errorize-test.js
Last active November 27, 2015 13:41 — forked from ryrych/errorize-test.js
After refactoring
```javascript
import errorize from '../../../utils/errorize';
import { module, test } from 'qunit';
module('Unit | Utility | errorize');
test('errorize', function(assert) {
var errors = {
responseJSON: {
errors:[
@tb
tb / gist:220b40d1e03c3dcaa237
Created October 28, 2015 15:29 — forked from trodrigues/gist:7414091
Angular.js directive test example with service mocking
describe('Directive test', function () {
var container, scope;
var aStub;
beforeEach(function () {
aStub = sinon.stub();
module('testmodule', function ($provide) {
$provide.value('someService', aStub);
});
@tb
tb / mtimediff.js
Last active September 27, 2015 07:34
mtimediff.js
#!/usr/bin/env node
var fs = require('fs');
if (process.argv.length <= 3) {
console.log("Usage: " + __filename + " file1 file2");
process.exit(-1);
}
var file1 = process.argv[2];
var file2 = process.argv[3];
@tb
tb / gulpfile.js
Last active August 29, 2015 14:27 — forked from Otann/gulpfile.js
var path = require('path'),
gulp = require("gulp"),
gutil = require("gulp-util"),
gfilter = require('gulp-filter'),
mocha = require('gulp-mocha'),
awspublish = require('gulp-awspublish');
var webpack = require("webpack"),
webpackGB = require('gulp-webpack-build'),
WebpackDevServer = require("webpack-dev-server");

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@tb
tb / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tb
tb / README.md
Last active August 29, 2015 14:15 — forked from magnetikonline/README.md
/**
* The MIT License (MIT)
*
* Copyright (c) 2013 Thom Seddon
* Copyright (c) 2010 Google
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
<p>Here comes the <b>bindable HTML</b> popover contents!!!</p>
<p>Number: {{number}}</p>