Skip to content

Instantly share code, notes, and snippets.

View sudodoki's full-sized avatar

Джон, просто Джон sudodoki

View GitHub Profile
@sudodoki
sudodoki / .jshintrc
Last active December 28, 2015 00:09 — forked from nkbt/.jshintrc
{
// All credits go to @nkbt
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
@sudodoki
sudodoki / Angular-outsideEvents.md
Last active February 15, 2017 15:17
jQuery outside events wrapper for Angular JS

jQuery outside events wrapper for Angular js.

In case you are willing to use jquery outside events plugin by @cowboy with Angular JS, and don't want to get your hands dirty, try this wrapper.
It defines oc-clickoutside, oc-dblclickoutside, oc-mouseoveroustide, oc-focusoutside directives you can use in your code.
In order to use with amd, don't forget to set path for outsideEvents.js and its dependency jQuery.
use just like you

 <popup oc-clickoutside="hidePopup()">Your awesome popup content.</popup>

In case you don't need amd, just strip out the define(['angular', 'outsideEvents'],function(angular){...}) part. Don't forget to load module while initializing your own.

Напишите конструктор my$, который принимает аргументом DOM селектор.
Реализуйте методы width, height которые соответсвенно изменяют ширишу и высоту всех селекторов,
которые мы определили ранее.
Пример:
var $div = my$('div')
console.log( $div ) //показать все div на странице.
var $red = my$('.red')
---
layout: post
title: "JS Course lessons & materials"
date: 2013-12-18 10:48
comments: true
categories:
---
#Links:
[http://programmers.stackexchange.com/questions/16528/single-statement-if-block-braces-or-no](http://programmers.stackexchange.com/questions/16528/single-statement-if-block-braces-or-no)
@sudodoki
sudodoki / inline_through.js
Created December 24, 2013 09:38
Resulting output to illustrate issue in nodeschool / discussions.
var http = require('http'),
through = require('through');
var server = http.createServer(function (req, res) {
if (req.method === 'POST') {
req.pipe(through(function (buf) {
this.queue(buf.toString().toUpperCase());
})).pipe(res)
} else {
res.end('Should be POST')
=== CI ===
http://martinfowler.com/articles/continuousIntegration.html
>Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. This article is a quick overview of Continuous Integration summarizing the technique and its current usage.
Practices of CI:
- Maintain a Single Source Repository
- Automate the Build
- Make Your Build Self-Testing
- Everyone Commits To the Mainline Every Day
- Keep the Build Fast
@sudodoki
sudodoki / README.md
Last active August 29, 2015 13:56
Small API for training purposes.

To run API, be sure to run npm install restify mongojs & you can enjoy it, after firing up mongo on local machine & executing node index.js

Напутствие

Тестирование Ангуляр приложений может строится на разных стеках, будем считать, что вы работаете с "самым правильным". Итак:

  • для юнит тестирование используется karma - бывший Testacular (который был переназван из-за хая, поднятого феменистками). В core-team есть разработчики ангуляра, поэтому часто называют карму продуктом команды ангуляра. Ранит ваши тесты или в бразуере, или в консоли (behind the scenes используя phantomjs - фантом).
  • для e2e (end-to-end) тестирование раньше предлагалось использовать karma-scenario, сейчас ангуляровцы предлагают использовать protractor - враппер (и немного утилсов для настройки) над селениумом.

Материалы

Много буков

[http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html](http://www.yearofmoo.com/2013/01/full-spectrum-testing-with

@sudodoki
sudodoki / index.js
Created May 5, 2014 10:48
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
console.log('express = ', express)
document.body.appendChild(canvas)
@sudodoki
sudodoki / Readme.md
Created May 10, 2014 21:40
Batch geolocate using Yandex geolocator