var fs = require('fs')
function(cb){
fs.readFile(process.argv[2], function(err, data){
if (err){
cb(err);
} else {
cb(null, data.toString())
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UI = require('ui'); | |
var Vector2 = require('vector2'); | |
var Vibe = require('ui/vibe'); | |
var menu = new UI.Menu({ | |
sections: [{ | |
title: 'Egg size', | |
items: [{ | |
title: 'Medium', | |
}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* React (with addons) v0.14.0-beta2 | |
*/ | |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
/** | |
* Copyright 2013-2015, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license fou |
- npm install request в локальной папке с решениями
- сохраните следующий код в отдельном файле get.js:
var request = require('request');
module.exports = function (url, cb){
request(url, function(error, response, body){
if (error){
cb(error);
} else {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Firmata is a generic protocol for communicating with microcontrollers | |
* from software on a host computer. It is intended to work with | |
* any host computer software package. | |
* | |
* To download a host software package, please clink on the following link | |
* to open the download page in your default browser. | |
* | |
* http://firmata.org/wiki/Download | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Задача | |
Пройти воркшоп http://nodeschool.io/#functionaljavascript | |
Шаги по установки описаны здесь: https://www.npmjs.org/package/functional-javascript-workshop | |
Успешно выполненные задания сохраняйте отдельными .js файлами в вашем git репозитории. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Задача №0. | |
Настроить JSHint для своего IDE | |
описание: http://www.jshint.com/install/ | |
Задача №1. | |
Реализация функции deepCopy - для копирования объекта с учетом вложенных объектов: | |
var a = {b: ‘c’, d: {e: ‘f’}}, | |
b = deepCopy(a); | |
a.d = 12; | |
b.d // {e: ‘f’} |
NewerOlder