Skip to content

Instantly share code, notes, and snippets.

View npofopr's full-sized avatar
🙃

Vladislav Altyncev npofopr

🙃
View GitHub Profile
function testUrl(){
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheet = doc.getSheetByName("PIMS");
var data = sheet.getRange(2,5,sheet.getLastRow(),1).getValues();
for (var i = 0; i < data.length; i++){
var responseCode = "-";
if (data[i][0].substring(0,4)=="http"){
try
{
var response = UrlFetchApp.fetch(data[i][0]);
@realmyst
realmyst / gist:1262561
Created October 4, 2011 19:34
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);
@Neolot
Neolot / gist:3105730
Created July 13, 2012 16:11
JQUERY Блоки равной высоты
// Equal height of the blocks
function setEqualHeight(blocks, etalon, correction){
blocks = $(blocks);
if ( blocks.length > 1 ) {
var tallest = 0;
blocks.each(function(){
var height = $(this).outerHeight(true);
if (tallest < height) tallest = height;
});
if (etalon && tallest < etalon) {
@balupton
balupton / README.md
Last active May 6, 2024 05:19
DocPad: Minify your assets with Grunt

DocPad: Minify your assets with Grunt

The following will minify your assets with grunt each time a generation write completes.

Installation

  1. Install Dependencies
@Neolot
Neolot / gist:3964353
Created October 27, 2012 11:30
JQUERY Автоочистка поля при фокусе
(function($) {
$(function() {
$('#selector').each(function(){
var text = $(this).val();
$(this)
.focusin(function(){
$(this).addClass('focus');
if ($(this).val() == text) $(this).val('');
})
.focusout(function(){
@Neolot
Neolot / gist:3964361
Created October 27, 2012 11:35
JQUERY Плавная прокрутка по якорям
/* Вешаем событие прокрутки на все якоря (#) на странице */
$('a[href^="#"]').bind('click.smoothscroll', function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop':$target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
});
@biakaveron
biakaveron / cusel-fixed-min-2.5.js
Created November 6, 2012 06:59
Обновленная версия cuSel (скроллинг работает с jQuery 1.7+)
/* -------------------------------------
cusel version 2.5
last update: 31.10.11
смена обычного селект на стильный
autor: Evgen Ryzhkov
updates by:
- Alexey Choporov
- Roman Omelkovitch
using libs:
@balupton
balupton / docpad.coffee
Last active July 27, 2016 10:40
DocPad: Automatically set custom Meta Data for items in a Collection
# Define our Configuration
docpadConfig =
# Define our own Collections
collections:
# Posts
# Anything outputted to the posts directory can be considered a post
# Sort the posts by newest first
# And set their layout to `post` automatically if it isn't already set
@balupton
balupton / README.md
Created February 11, 2013 03:52
DocPad: Clean dates in post URLs

DocPad: Clean dates in post URLs

Creates URLs like /2012/12/15/merry-xmas for your blog posts.

Requires momentjs to be installed: npm install --save moment

Node.js Resources

What is node.js?

Node.js is just JavaScript running on the server side. That's it. That's all there is to it.

Express

  • Express Docs, if you want to get started and already know JavaScript this is the place to be