Skip to content

Instantly share code, notes, and snippets.

View IPRIT's full-sized avatar
💅

Alexander Belov IPRIT

💅
View GitHub Profile
// your code goes here.
var element = document.querySelector('.block');
var ball = document.querySelectorAll('.ball');
var count = 0;
function fn (e) {
var coords = {
x: 0,
y: 0
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Титле</title>
<script>
document.addEventListener('DOMContentLoaded', function () {
var script = document.createElement('script');
script.src = './task.js';
document.body.appendChild(script);
@IPRIT
IPRIT / .cs
Created October 3, 2015 17:59
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lab1
{
class CBasicRandomValue
/**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name: 'Fiji Islands', continent: 'Oceania'},
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 = {
(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() {
@IPRIT
IPRIT / rules.md
Last active August 26, 2015 08:12
Contribution rules

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

git clone [email protected]:имя-вашего-пользователя/repo.git 

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

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

git remote add upstream git://github.com/repo/repo.git
@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'},
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();