Skip to content

Instantly share code, notes, and snippets.

View npofopr's full-sized avatar
🙃

Vladislav Altyncev npofopr

🙃
View GitHub Profile
@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) {
@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, ['найдена', 'найдено', 'найдены']);
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]);