Skip to content

Instantly share code, notes, and snippets.

@Spec007
Spec007 / reversearray.js
Created February 18, 2017 06:07
Eloquent Javascript: Reversing an Array
/* For this exercise, write two functions, reverseArray and
reverseArrayInPlace. The first, reverseArray, takes an array
as argument and produces a new array that has the same
elements in the inverse order. The second, reverseArrayInPlace,
does what the reverse method does: it modifies the array given
as argument in order to reverse its elements. Neither may use
the standard reverse method. */
function reverseArray(array) {
var newArray = [];
@Spec007
Spec007 / media-queries.css
Created January 24, 2017 14:28
Media-queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@Spec007
Spec007 / bind.js
Last active January 20, 2017 16:21
Привязка контекста
function bind(func, context) {
return function() {
return func.apply(context, arguments);
}
}
@Spec007
Spec007 / timer.js
Last active January 20, 2017 13:21
Таймер с обратным отсчетом
function get_timer() {
var date = new Date(),
year = date.getFullYear(),
month = date.getMonth()+1;
if (month > 2) ++year;
//Дата для обратного отсчета
var date_new = 'February 01,' + year + ' 00:00',