Skip to content

Instantly share code, notes, and snippets.

View IPRIT's full-sized avatar
💅

Alexander Belov IPRIT

💅
View GitHub Profile
@IPRIT
IPRIT / index.html
Last active August 29, 2015 14:24
mJXZqy
#button.block
.wrapper
.line.first
.line.second
.line.third
.layer
.button.block1
.wrapper
.line.first
.line.second
.line.third
.button.block2
.wrapper
.line.first
.line.second
var utils = require("./utils");
var MisisBooksApi = require("./misisbooksapi");
var unirest = require('unirest');
var uniqChats = {};
module.exports = {
handler: function(req, res) {
var params = req.body;
if (!params.update_id) {
return res.end();
@IPRIT
IPRIT / shri.js
Last active August 29, 2015 14:27 — forked from verkholantsev/shri.js
/**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name :'Fiji Islands', continent: 'Oceania'},
@IPRIT
IPRIT / rules.md
Last active August 26, 2015 08:12
Contribution rules

1. Сделайте "форк" репозитория, а затем клонируйте его в свою локальную среду разработки

git clone git@github.com:имя-вашего-пользователя/repo.git 

2. Добавьте основой репозиторий repo как удаленный (remote) с названием "upstream"

Перейдите в директорию куда вы сделали клон на первом шаге и выполните следующую команду:

git remote add upstream git://github.com/repo/repo.git
(function (window) {
var keyPrefix = '';
var noPrefix = false;
var cache = {};
var useCs = false;
var useLs = !useCs && !!window.localStorage;
function storageSetPrefix(newPrefix) {
keyPrefix = newPrefix;
}
function storageSetNoPrefix() {
(function (window) {
var keyPrefix = '';
var noPrefix = false;
var cache = {};
var useCs = false;
var useLs = !useCs && !!window.localStorage;
function storageSetPrefix(newPrefix) {
keyPrefix = newPrefix;
}
function storageSetNoPrefix() {
JavaScript implements 'duck' typing. Duck typing is a style of dynamic typing in which an object's methods and properties determine the valid semantics, rather than its inheritance from a particular class or implementation of a
specific interface. The name of the concept refers to the duck test, attributed to James Whitcomb Riley, which may be phrased as follows:
"When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck"
In JavaScript, in order to write robust programs we sometimes need to check an object conforms to the type that we need.
We can use Object#hasOwnProperty to detect if an object 'has' a property defined on itself (i.e. not inherited from its prototype):
var duck = {
/**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name: 'Fiji Islands', continent: 'Oceania'},