Demonstrating testing outputs for
https://github.com/angular-ui/bootstrap
Changes:
// in karma.conf.js
reportSlowerThan: 300,
var gulp = require('gulp'); | |
// Let's make things more readable by | |
// encapsulating each part's setup | |
// in its own method | |
function startExpress() { | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static(__dirname)); |
Demonstrating testing outputs for
https://github.com/angular-ui/bootstrap
Changes:
// in karma.conf.js
reportSlowerThan: 300,
<!-- | |
Web Application with Backbone: BEGINNER TUTORIAL | |
Backbone.js is a very popular and light(weight) JavaScript library | |
for building Web Applications. | |
However, learning it I found frustratingly few simple examples of | |
true workable applications with all lines of code explained. | |
Here is my attempt to hack the popular Jerome Gravel-Niquet's Backbone Todo App |
<?php | |
class StackmobStore implements OutStore { | |
// Create new hashes with preserved Ids | |
public function createManyWithId ($schema, array $array) { | |
$adjustedArray = $this->_adjustIdMany($schema, $array); | |
return $this->createMany($schema, $adjustedArray); | |
} | |
/** Creating new hashes on StackMob DB |
<?php | |
class ParseStore implements OutStore { | |
/** Creating new hashes on Parse DB | |
* @param string $schema - Parse schema (class) | |
* @param array $array - Array of Hashes | |
* @return array $ids - Parse IDs of entries created | |
*/ | |
public function createMany ($schema, array $bundle) { | |
$bundle = $this->_moveIds($bundle); |
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |
<!-- | |
Web Application with Backbone: BEGINNER TUTORIAL | |
Backbone.js is a very popular and light(weight) JavaScript library | |
for building Web Applications. | |
However, learning it I found frustratingly few simple examples of | |
true workable applications with all lines of code explained. | |
Here is my attempt to hack the popular Jerome Gravel-Niquet's Backbone Todo App |
var _ = require('lodash'); | |
var log = require('../core/log.js'); | |
var RSI = require('./indicators/RSI.js'); | |
// let's create our own method | |
var method = {}; | |
// prepare everything our method needs | |
method.init = function() { |
function C (I_1, I_2, I_3) { | |
J_1 = f_1(I_1, I_2, I_3) | |
J_2 = f_2(I_1, I_2, I_3) | |
return [J_1, J_2] | |
} |