Skip to content

Instantly share code, notes, and snippets.

View ilyavf's full-sized avatar

Ilya ilyavf

View GitHub Profile
@ilyavf
ilyavf / 0_readme.md
Last active November 2, 2016 23:02
can-fixture-socket for test pages

Socket.io, can-fixture-socket and mocked services need to be evaluated before importing app models.

Async tests have to wait till dynamic import completes.

@ilyavf
ilyavf / 0_readme.md
Last active November 2, 2016 17:42
can-fixture-socket for demo pages

The rough-demo.html just shows whats needed to make the demo working.

The rest is the better structurized example:

  • demo.html - demo with less boilerplate.
  • contribution-months.js - exports mockContributionMonthsService that expects mockServer and mocks Feathers service for contributionMonths;
  • contribution-months.json - json data for can-fixture.store to be used for mocking Feathers service.
@ilyavf
ilyavf / README.md
Last active September 15, 2016 05:46
CanJS: scope lookup examples

The ./ is used to refer to current scope without parent lookup. The ../ is used to look up values in parent scope. A scope is defined:

  • either for a helper like: {{#each items}} here current scope {{./}} will refer to the current element of items {{/each}}
  • or for a component: <bit-tabs> here {{./}} will refer to bit-tabs' viewModel </bit-tabs>.

The lookup is done automatically, but if one and the same property is defined (or even undefined but still intended to be) for both the current scope and the parent scope, then you may want to specify which one you want to refer to by using {{../}} to climb up to parent or by {{./}} to stay on current scope.

@ilyavf
ilyavf / Gruntfile.js
Last active November 28, 2024 05:41
Steal tools build intermittent issue. Happens
...
grunt.initConfig({
'steal-build': {
main: {
options: {
system: {
config: __dirname + '/package.json!npm',
main: 'index'
},
buildOptions: {

Right Notes

Coding Conventions

Whitespace

  • Always spaces, never tabs
  • 2 spaces indents
@ilyavf
ilyavf / min-data-req.md
Last active September 30, 2015 03:36
DoneJS Features - Minimal Data Requests

Caching and Minimal Data Requests

http://donejs.com/Features.html#section=section_Cachingandminimaldatarequests

Description:

DoneJS applications are able to do variety of performance improvements by intelligently managing the data layer.

One of the slowest actions for a web page is a network request. SPA tend to do a lot of AJAX calls asking server for necessary data. Latency is more noticeable during initial load of the application, but also if a lot of user actions on the page are accompanied by AJAX calls, user might soon get bored with loading spinners. Also, consider browsing from a mobile device where network connection could be unstable or slow, it might be very difficult to create a responsive user experience.

There are the following five strategies available to help reduce the amount and size of data requests: