I hereby claim:
- I am i-hun on github.
- I am ihun (https://keybase.io/ihun) on keybase.
- I have a public key ASBhm2M2hPPzVOZOB5EsVjOVTZquRH3ud-vu3GHQpELyKAo
To claim this, I am signing this object:
//general Handlebars helper that we can use anywhere | |
Handlebars.registerHelper("formatDate", function(date) { | |
return new Handlebars.SafeString( | |
moment(date).format('LL') | |
); | |
}); | |
//Плюрализация. Работает для всех шаблонов. | |
Handlebars.registerHelper('pluralize', function(n, thing) { |
$ git init | |
$ git add -A | |
$ git commit -m "Created Errors Package" | |
$ git remote add origin https://github.com/tmeasday/meteor-errors.git | |
$ git push origin master |
Template.nestedTemplate.events({ | |
'click a.class':function(event,template){ | |
var parentID = template.data._id; | |
console.log(parentID); | |
} | |
}); | |
//http://stackoverflow.com/questions/13091914/meteor-how-to-access-parent-properties-within-nested-templates |
Не сразу понял, как в meteor выполнить сортировку по вложенным свойствам. Надо всего лишь взять их в кавычки: | |
Events.find({}, {sort: {"properties.title": 1}}); | |
Это правило применимо к mongoDB в целом. |
var eventsHandle = Meteor.subscribe('events'); | |
var onReady = Deps.autorun(function () { | |
eventsHandle.ready(); | |
}); | |
onReady.onInvalidate(function() { | |
Events.find().observeChanges({ | |
_suppress_initial: true, | |
added: function(id, event) { |
http://stackoverflow.com/questions/1122690/jquery-and-questions/1122740#1122740 | |
Let's rewrite this code a little bit to understand what's going on. | |
function complicatedFunction($) { | |
// the document.ready call goes here. | |
} | |
Next, how would you call this function? | |
complicatedFunction(someObject); | |
So inside the complicatedFunction $ refers to someObject. Agree? |
# Prototype | |
http://habrahabr.ru/post/117868/ | |
arguments -- переменная, доступная внутри функции и содержащая аргументы и ссылку на саму функцию. | |
Несмотря на доступ по индексу и наличие свойства length, arguments не является массивом, т.е не принадлежит типу Array. | |
Поэтому для arguments нельзя напрямую вызвать методы этого класса: | |
arguments.pop() // ошибка ! | |
Можно, однако, вызвать методы Array через apply/call: | |
var args = Array.prototype.slice.call(arguments, 0) //Мы вызываем метод slice прототипа Array от лица arguments. |
from __future__ import division | |
from gensim import corpora, models, similarities, matutils | |
import numpy as np | |
import scipy.stats as stats | |
from scipy.sparse import linalg as splinalg | |
from scipy.sparse import * | |
import matplotlib.pyplot as plt | |
import h5py | |
from pymongo import MongoClient |
I hereby claim:
To claim this, I am signing this object:
#! /usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import json | |
import httplib2 | |
from datetime import datetime | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2WebServerFlow |