This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
let tables = document.querySelectorAll("table"); | |
let copy = collection => Array.prototype.slice.call(collection); | |
tables = copy(tables); | |
tables.forEach(item => { | |
let thead = copy(item.tHead.rows[0].cells).map(item => item.textContent); | |
let tbody = copy(item.tBodies).forEach( | |
tbody => copy(tbody.rows).forEach( | |
row => copy(row.cells).forEach( | |
(cell, index) => cell.setAttribute('data-title', thead[index])))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var fs = require('fs'); | |
var md = require('to-markdown'); | |
var ic = require('iconv-lite'); | |
var src = 'docs'; | |
var dist = 'dist'; | |
fs.readdir(src, (err, contents) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convert() { | |
"use strict"; | |
let initialNotation = parseInt($("#initial-notation").prop('value')); | |
let resultNotation = parseInt($("#result-notation").prop('value')); | |
let initialValue = $("#initial-value").prop('value'); | |
let resultValue = $("#result-value"); | |
let valueWithExcess = $("#with-excess"); | |
let toDecimalNotation = (value, notation) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string[] files = Directory.GetFiles(@"../../", "*.json"); | |
foreach(string filename in files) | |
{ | |
Console.WriteLine("File: " + filename); | |
List<dynamic> data = import(filename); | |
foreach(dynamic subset in data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header>...</header> | |
<div class="clearfix"> | |
<section>...</section> | |
<aside>...</aside> | |
</div> | |
<footer>...</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isSheetExist(sheetName) { | |
return SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName) != null; | |
} | |
function formResponseFilter(e) { | |
if (!e) throw new Error("Please go the Run menu and choose Initialize"); | |
try { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var base = ss.getSheets()[0]; | |
var sheet = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = service.Spreadsheets.Get(sheet_id); | |
var response = request.ExecuteAsync(); | |
response.Wait(new CancellationToken(response.IsCompleted)); | |
Console.WriteLine("Async request complited."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Грея => Дополнительный | |
"use strict"; | |
let rand = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; | |
let toDecimal = (value, notation) => | |
value.split('').map((char, i, arr) => | |
parseInt(char) * Math.pow(notation, arr.length - (i + 1))) | |
.reduce((sum, current) => sum + current); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
let rand = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min; | |
// Перевод двоичного числа в десятичное | |
// Двоичное число приходит в ф-цию в виде строки | |
let toDecimal = (value) => | |
value.split('') // Преобразуем строку в массив символов | |
// Считаем по формуле - https://goo.gl/eJ8KcJ | |
// Доп. читай про ф-ции `map` и `reduce`: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var valueRange = new Google.Apis.Sheets.v4.Data.ValueRange(); | |
var values = new List<string[]>(); | |
var range = currentSheet.Title + "!H2:H" + currentSheet.Rows.Count + 1; | |
foreach (var row in currentSheet) | |
{ | |
string[] cell = { row.Value[lastSheetCaption] }; | |
values.Add(cell); | |
} |
OlderNewer